Message148922
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. |
|
Date |
User |
Action |
Args |
2011-12-06 15:00:19 | pitrou | set | recipients:
+ pitrou, r.david.murray, docs@python, Guillaume.Bouchard |
2011-12-06 15:00:19 | pitrou | set | messageid: <1323183619.04.0.429338748952.issue13538@psf.upfronthosting.co.za> |
2011-12-06 15:00:18 | pitrou | link | issue13538 messages |
2011-12-06 15:00:18 | pitrou | create | |
|