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 ;-)
Seriously, it doesn't help being purist over concepts that are used in a very pragmatic way in every day (programmer's) life.
Even when being binary data, most such binary strings do contain encoded text characters and being able to quickly identify those as such helps in debugging, working with the data and writing it down in form of literals.
A definite -1 from me on making repr(b"Hello World") harder to read than necessary.