I ran into a strange issue today. I was using the Python standard library's string
module's letters
variable and noticed that the result in bpython was not the same as the result in vanilla python.
I'm using Python 2.7.3 and bpython 0.10.1 and virtualenv 1.8.4. Here is what I'm seeing.
$ bpython
>>> import string
>>> string.letters
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
$ python
>>> import string
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
I'm not sure that it matters but I'm running this on xubuntu 12.10.
Can someone please explain what is going on here?
string.letters = string.ascii_upper + string.ascii_lower
and the other didstring.letters = string.ascii_lower + string.ascii_upper
, I dont think it will have any effect on any of your programs (unless you are trying to dostring.letters[:26]
or something) – Ignominystring.letters
I get the same results as you, but usingstring.ascii_letters
I get'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
in both python and bpython. – Maxama