[issue19619] Blacklist base64, hex, ... codecs from bytes.decode() and str.encode()
Serhiy Storchaka
report at bugs.python.org
Tue Nov 19 16:41:40 CET 2013
Serhiy Storchaka added the comment:
Blacklisting by name is slow and it prevents a user from defining a codec with blacklisted name.
What if just add private attribute ("_not_text"?) to unsafe codecs? If a codec has this attribute, than it should not be used it text encoding/decoding. Checking an attribute is much faster than comparing with a couple of strings.
Another possibility is an inheriting all unsafe codecs from special class.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19619>
_______________________________________
More information about the Python-bugs-list
mailing list