Martin Panter added the comment:

Also, “-bb” turns it into an exception, and the same applies to bytes vs int:

>>> b"a" == "a"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
BytesWarning: Comparison between bytes and string
>>> b"a" == 0x61
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
BytesWarning: Comparison between bytes and int

Perhaps the documentation should say “should not be compared” rather than 
“cannot”. Or perhaps it should mention “-b”.

Mariatta: I don’t think this is relevant to 2.7. In 2.7, you do get an error 
with bytearray vs unicode, but bytearray is not discussed in this bit of the Py 
2 documentation.

----------
nosy: +Mariatta, martin.panter

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

Reply via email to