Message217703
Unfortunately it's impossible to warn against this in Python 2 since the bytes type is just another name for the str type:
>>> str == bytes
True
>>> type(b'1')
<type 'str'>
What we could potentially do, though, is change things such that -3 does what you are after when comparing bytes/str to unicode in Python 2. Unfortunately in that instance it's still a murky question as to whether that will help things more than hurt them as some people explicitly leave strings as-is in both Python 2 and Python 3 for either speed or code simplicity reasons. |
|
Date |
User |
Action |
Args |
2014-05-01 14:58:59 | brett.cannon | set | recipients:
+ brett.cannon, vstinner, ezio.melotti, Joshua.J.Cogliati |
2014-05-01 14:58:59 | brett.cannon | set | messageid: <1398956339.3.0.404595759488.issue21401@psf.upfronthosting.co.za> |
2014-05-01 14:58:59 | brett.cannon | link | issue21401 messages |
2014-05-01 14:58:59 | brett.cannon | create | |
|