Python: string.uppercase vs. string.ascii_uppercase

python

Solution

For Python 2.7, the difference is: (see https://docs.python.org/2.7/library/string.html )

string.ascii_uppercase:

- The uppercase letters 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. This value is not locale-dependent and will not change.

string.uppercase:

- A string containing all the characters that are considered uppercase letters. On most systems this is the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. The specific value is locale-dependent, and will be updated when locale.setlocale() is called.

In Python 3+ `string.uppercase` does not exist as a global "constant" anymore. ( https://docs.python.org/3/library/string.html )

Problem

This might be a stupid question but I don't understand what's the difference between string.uppercase and string.ascii_uppercase in the string module. Printing the docstring of both the function prints same thing. Even the output of `print string.uppercase` and `print string.ascii_uppercase` is same. Thanks.

Original source