[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

Serhiy Storchaka report at bugs.python.org
Thu May 12 07:20:01 EDT 2016


Serhiy Storchaka added the comment:

What do you propose? Note that str.encode() doesn't raise an exception. Ascii unicode and 8-bit strings are interchangeable. Ascii unicode strings can be packed in str for less memory consumption (see xmlrpclib or ElementTree), a lot of str constant are used in unicode context (like os.sep or empty string). Breaking str.encode() will break valid existing code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26369>
_______________________________________


More information about the Python-bugs-list mailing list