Message194652
pprint._safe_repr for type str uses much slower codepath by default, which does not makes a sense in Python3 context. Instead of simply using repr, it check the existence of 'locale' in sys.modules and if found, it goes one-by-one-char call str.isalpha() on each and apply the quoting for non-alpha chars. This is extremely slow, but as locale is usually in sys.modules, it's used by default.
The point of such code was because in python2, str.isalpha() depends on locale, so for locale-aware Python builds, there was a different path needed. But this does not apply for Python3, where all strings are unicode, so .isaplha() is not locale sensitive anymore. |
|
Date |
User |
Action |
Args |
2013-08-08 08:29:26 | mvyskocil | set | recipients:
+ mvyskocil |
2013-08-08 08:29:26 | mvyskocil | set | messageid: <1375950566.41.0.226660086473.issue18682@psf.upfronthosting.co.za> |
2013-08-08 08:29:26 | mvyskocil | link | issue18682 messages |
2013-08-08 08:29:26 | mvyskocil | create | |
|