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 mark.dickinson
Recipients mark.dickinson, sbermeister
Date 2012-05-24.10:41:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337856062.63.0.825855425051.issue14898@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2012-05-24 10:41:02mark.dickinsonsetrecipients: + mark.dickinson, sbermeister
2012-05-24 10:41:02mark.dickinsonsetmessageid: <1337856062.63.0.825855425051.issue14898@psf.upfronthosting.co.za>
2012-05-24 10:41:02mark.dickinsonlinkissue14898 messages
2012-05-24 10:41:01mark.dickinsoncreate