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 <report@bugs.python.org> <http://bugs.python.org/issue30435> _______________________________________