On 18/06/2019 18.32, Daniel Holth wrote: > set([u"foo", b"foo]) will error because the two kinds of string have the > same hash, and this causes a comparison. Is that correct?
Yes, it will fail with -bb, because it turns comparison between str and bytes into an error. This can also happen with other strings when hash(u'somestring') & mask == hash(b'otherbytes') & mask. The mask of a set starts with PySet_MINSIZE - 1 == 8 and increases over team. Christian _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/ZIF2MRBWSMSCFP6E7PZOBI5KYP46QZPK/