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 vstinner
Recipients Arfrever, Joshua.J.Cogliati, brett.cannon, cvrebert, ezio.melotti, jrincayc, serhiy.storchaka, vstinner
Date 2014-06-02.09:21:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401700871.29.0.187366447733.issue21401@psf.upfronthosting.co.za>
In-reply-to
Content
Serhiy wrote:
"I think that even if we accept this change (I am unsure in this), a warning should be raised only when bytes and unicode objects are equal. When they are not equal, a warning should not be raised, because this matches Python 3 behavior."

Python 3 warns even if strings are equal.

$ python3 -b -Wd
Python 3.3.2 (default, Mar  5 2014, 08:21:05) 
e" for more information.
>>> b'abc' == 'abc'
__main__:1: BytesWarning: Comparison between bytes and string
False
>>> b'abc' == 'abc'
False

The warning is not repeat in the interactive interprter because it is emited twice at the same location "__main__:1".
History
Date User Action Args
2014-06-02 09:21:11vstinnersetrecipients: + vstinner, brett.cannon, ezio.melotti, Arfrever, cvrebert, jrincayc, serhiy.storchaka, Joshua.J.Cogliati
2014-06-02 09:21:11vstinnersetmessageid: <1401700871.29.0.187366447733.issue21401@psf.upfronthosting.co.za>
2014-06-02 09:21:11vstinnerlinkissue21401 messages
2014-06-02 09:21:10vstinnercreate