Python: string.uppercase vs. string.ascii_uppercase

This might be a dumb question, but I don’t understand what the difference is between string.uppercase and string.ascii_uppercase in a string module. Printing the docstring of both functions prints the same. Even the conclusion print string.uppercaseand print string.ascii_uppercasethe same.

Thank.

+5
source share
3 answers

See: http://docs.python.org/library/string.html

string.ascii_uppercase:

  • Capital letters "ABCDEFGHIJKLMNOPQRSTUVWXYZ". This value is language independent and does not change.

string.uppercase:

  • , , . "ABCDEFGHIJKLMNOPQRSTUVWXYZ". locale.setlocale().
+16

, Python 3.x string.uppercase, string.lowercase string.letters vapourised. "", . (. http://docs.python.org/py3k/whatsnew/3.0.html)

, , , Python 2.x. , , - Python 3.x

+8

(.. ), [:upper:] regex.UNICODE regex.

-1
source

All Articles