This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mvyskocil
Recipients mvyskocil
Date 2013-08-08.08:29:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375950566.41.0.226660086473.issue18682@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-08-08 08:29:26mvyskocilsetrecipients: + mvyskocil
2013-08-08 08:29:26mvyskocilsetmessageid: <1375950566.41.0.226660086473.issue18682@psf.upfronthosting.co.za>
2013-08-08 08:29:26mvyskocillinkissue18682 messages
2013-08-08 08:29:26mvyskocilcreate