18 Jun
2019
18 Jun
'19
4:57 p.m.
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