string module

Phil Hystad philh at nwlink.com
Sun May 19 20:43:16 EDT 2002


I have python on linux (suse) and the string.uppercase and string.lowercase
values are a bit strange.

For example, string.uppercase has the following values:

ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC0\xC1\xC2....\xCde


And, lowercase has the same problem....plus, the string.letters has the
values concatenated and there are two sets of these escaped hex codes.

What is this all about?  I was expected just the 26 letters.  The length is
not correct either:

    >>>len(string.uppercase)
    56
    >>>

So, it reports a length of 56 instead of 26.

I checked locale and it is correct for me (english).

Is this a garbled module or a feature?

phil






More information about the Python-list mailing list