Am 11.09.19 um 15:34 schrieb Daniel Holth:

It's different. One hint is that there's already an option to disable the feature. The old style of error will occasionally reveal itself with decode errors but the new style error happens silently, you discover it somehow, then enable the -bb option, track down the source of the error, and deal with the fallout. The proposed change would allow `print(bytes)` for (de)bugging by letting you toggle `python3 -bb` behavior at runtime instead of only at the command line. Or you could debug more explicitly by `print(bytes.decode('ebcdic'))` or `print(repr(bytes))`

I didn't realize you could override __builtins__.str. That's interesting.

Being able to call str() on everything is such a fundamental assumption that changing the behavior of str(bytes) would break Python. Porting from Python 2 to Python 3 is a big task and especially the str/unicode/bytes handling needs extra care, and this is one of those corner cases that might prove problematic when porting. That doesn't justify breaking Python, especially not for those users that have decided to port to Python 3 in a timely manner.

 - Sebastian

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/PUDMIH55ZCVWNWLTCIC4PLYJM2XZSN22/

Reply via email to