STINNER Victor added the comment:

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".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21401>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to