[issue9873] Allow bytes in some APIs that use string literals internally
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>
More information about the Python-bugs-list