This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients Joshua.J.Cogliati, brett.cannon, ezio.melotti, vstinner
Date 2014-05-01.14:58:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398956339.3.0.404595759488.issue21401@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-05-01 14:58:59brett.cannonsetrecipients: + brett.cannon, vstinner, ezio.melotti, Joshua.J.Cogliati
2014-05-01 14:58:59brett.cannonsetmessageid: <1398956339.3.0.404595759488.issue21401@psf.upfronthosting.co.za>
2014-05-01 14:58:59brett.cannonlinkissue21401 messages
2014-05-01 14:58:59brett.cannoncreate