Antoine Pitrou <pit...@free.fr> added the comment: Well, I forgot to mention it in my previous message, but there is already a warning that you can activate with the -b option:
$ ./python -b Python 3.3.0a0 (default:6b6c79eba944, Dec 6 2011, 11:11:32) [GCC 4.5.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> str(b"") __main__:1: BytesWarning: str() on a bytes instance "b''" And you can even turn it into an error with -bb: $ ./python -bb Python 3.3.0a0 (default:6b6c79eba944, Dec 6 2011, 11:11:32) [GCC 4.5.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> str(b"") Traceback (most recent call last): File "<stdin>", line 1, in <module> BytesWarning: str() on a bytes instance However, -b is highly unlikely to become the default, for the reasons already explained. It was mainly meant to ease porting from Python 2. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13538> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com