[issue9873] Allow bytes in some APIs that use string literals internally

Nick Coghlan report at bugs.python.org
Wed Sep 29 23:55:58 CEST 2010


Nick Coghlan <ncoghlan at gmail.com> added the comment:

One of Antoine's review comments made me realise I hadn't explicitly noted the "why not decode with latin-1?" rationale for the bytes handling. (It did come up in one or more of the myriad python-dev discussions on the topic, I just hadn't noted it here)

The primary reason for supporting ASCII compatible bytes directly is specifically to avoid the encoding and decoding overhead associated with the translation to unicode text. Making that overhead implicit rather than avoiding it altogether would be to quite miss the point of the API change.

----------

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


More information about the Python-bugs-list mailing list