Mark Dickinson <dicki...@gmail.com> added the comment:

Thanks for the report.  Yes, this is expected.  Dictionary membership is based 
on equality of keys.  Since True and 1 are equal, only one of them can be 
present in a dictionary at a time (and a key lookup works with either).

>>> x = {0: 'bar'}
>>> x[0]
'bar'
>>> x[False]
'bar'
>>> x[0.0]
'bar'
>>> 0 == False
True

----------
nosy: +mark.dickinson
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14898>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to