Message294233
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. |
|
Date |
User |
Action |
Args |
2017-05-23 06:11:26 | martin.panter | set | recipients:
+ martin.panter, ipatrol, docs@python, eryksun, Mariatta |
2017-05-23 06:11:26 | martin.panter | set | messageid: <1495519886.68.0.820282889272.issue30435@psf.upfronthosting.co.za> |
2017-05-23 06:11:26 | martin.panter | link | issue30435 messages |
2017-05-23 06:11:26 | martin.panter | create | |
|