A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-November/040080.html below:

[Python-Dev] other "magic strings" issues

[Python-Dev] other "magic strings" issuesBarry Warsaw barry at python.org
Fri Nov 7 13:44:23 EST 2003
On Fri, 2003-11-07 at 12:35, Guido van Rossum wrote:

> Hm, I'd forgotten about ascii_letters.  It would make a beautiful
> class attribute of str.
> 
> I *do* think that we don't need string.letters -- the only use for it
> I've seen is checking if a character is in that string, and
> c.isletter() is faster.

Ah gotcha.  I'd definitely want to retain ascii_letters, probably
ascii_lowercase and ascii_uppercase, digits, hexdigits, octdigits,
punctuation, printable, and whitespace.  I'm not sure about the locale
specific constants, but maybe we do something like:

str.ascii.letters
str.ascii.lowercase
str.locale.letters
str.locale.lowercase

I'd definitely want to make these all read-only, e.g. removing the
undefined warnings for string.lowercase.

-Barry



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4