2 ms·
Oddly, it also wasn’t the case for Python 2 Unicode strings (u'INFO'), only for Python 2 byte strings ('INFO'). So it’s possible that Python 3 lost this behavi
by anderskaseorg 6y ago
Oddly, it also wasn’t the case for Python 2 Unicode strings (u'INFO'), only for Python 2 byte strings ('INFO'). So it’s possible that Python 3 lost this behavior by accident.
- price 6y agoOn some more digging through history, it looks like the change in behavior for byte strings was intentional: https://github.com/python/cpython/commit/6ccd3f2dbcb98b33a71ffa6eae949deae797c09c https://github.com/python/cpython/commit/6ccd3f2dbcb98b33a71... Author: Guido van Rossum <guido@python.org> Date: Tue Oct 9 03:46:30 2007 +0000 Replace all (locale-dependent) uses of isupper(), tolower(), etc., by locally-defined macros that assume ASCII and only consider ASCII letters.