Marc-Andre Lemburg <m...@egenix.com> added the comment:

Mark Dickinson wrote:
> 
> Mark Dickinson <dicki...@gmail.com> added the comment:
> 
> Thanks for the patch.
> 
> Rather than remove that optimization entirely, I'd consider pushing it into 
> PyUnicode_Decode.
> 
> All tests (whether for the standard library or for the core) go into 
> Lib/test, so that would be the right place.  test_codecs_errors in 
> Lib/test/test_unicode.py looks appropriate.
> 
> Adding Marc-André to the nosy list:  this is much more his domain than mine.

I think this is a case for "practicality beats purity": an empty
encoded object will in all practical cases result in an empty Unicode
object when decoded, regardless of which encoding is used.

It's not a 100% clean approach, but does help performance a lot since
you avoid the intermediate conversions, lookups, etc.

If you want to check whether an encoding is registered or not,
you should normally use the codecs.lookup() function.

In which specific case did you find the problem you mentioned ?

----------

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

Reply via email to