On 10.09.2014 09:43, Nick Coghlan wrote:
On 10 September 2014 17:36, M.-A. Lemburg mal@egenix.com wrote:
On 10.09.2014 09:04, Chris Lasher wrote:
Why did the CPython core developers decide to force the display of ASCII characters in the printable representation of bytes objects in CPython 3?
This wasn't forced. It's a simple consequence of turning the Python 2 8-bit string type into the Python 3 bytes type while keeping breakage to a pain level which doesn't have Python users skip Python 3 entirely ;-)
I believe you may be forgetting the pre-release period where there wasn't an immutable bytes types at all. It wasn't until PEP 3137 [1] was implemented that we got to the status quo for Python 3.
Oh, I do know. That was a path which was luckily quickly abandoned as default bytes type :-)
Note that we now have PyByteArray C APIs in Python 3 for bytearray objects. PyBytes C APIs are (mostly) the Python 2 PyString C APIs - unlike what's listed in the PEP.
Cheers, Nick.
P.S. I haven't forgotten my promise to try to put together a recipe for a cleaner wrapper around "memoryview(data).cast('c')", but it may be a while before I get back to the idea.