Glenn Linderman <v+pyt...@g.nevcal.com> added the comment:

Patch is interesting, using an encoder to detect validity. However, it suffers 
from some performance problems for long text that has large ASCII prefixes.

This seems to be an enhancement sort of request rather than a bug... so I 
wonder why Python 3.2 is listed?

And in Python 3.3 with PEP 393 strings the C API to strings provides a quick 
way to determine the maximum character in the string... although I see nothing 
in the PEP about how to access that information from Python. If it is 
available, it could provide a much quicker precheck rather than multiple 
attempts to encode strings with large ASCII prefixes only to discover that the 
next to last character is in (128,255) and the last character is > 255 (which 
would be about the worst case scenario for the algorithm in the patch).

----------
nosy: +v+python

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15016>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to