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 martin.panter
Recipients Mariatta, docs@python, eryksun, ipatrol, martin.panter
Date 2017-05-23.06:11:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495519886.68.0.820282889272.issue30435@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-05-23 06:11:26martin.pantersetrecipients: + martin.panter, ipatrol, docs@python, eryksun, Mariatta
2017-05-23 06:11:26martin.pantersetmessageid: <1495519886.68.0.820282889272.issue30435@psf.upfronthosting.co.za>
2017-05-23 06:11:26martin.panterlinkissue30435 messages
2017-05-23 06:11:26martin.pantercreate