[issue9636] {'key': 'value'}[b'key'] raises a BytesWarning
STINNER Victor
report at bugs.python.org
Thu Aug 19 12:25:31 CEST 2010
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
Oh. flox told me that there are other cases raising BytesWarning:
'abc' in {b'abc'}
'abc' in (b'xxx',)
'abc' in [b'xxx']
I suppose that the behaviour is different (only fail with same value / fail with different values) because set does first compare the hash (as dict), whereas tuple and list use a classic comparaison.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9636>
_______________________________________
More information about the Python-bugs-list
mailing list