str attributes

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Dec 7 01:52:57 CET 2005


I don't know if this was already discussed. I think that maybe Python
2.5 can add some attributes to the str object:

>>> str.ascii_letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> str.hexdigits
'0123456789abcdefABCDEF'
etc.

And maybe this too:
str.maketrans(from, to)

(I think string.capwords() isn't important enough to be added too).

Bye,
bearophile




More information about the Python-list mailing list