Message161498
| 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:02 | mark.dickinson | set | recipients:
+ mark.dickinson, sbermeister |
| 2012年05月24日 10:41:02 | mark.dickinson | set | messageid: <1337856062.63.0.825855425051.issue14898@psf.upfronthosting.co.za> |
| 2012年05月24日 10:41:02 | mark.dickinson | link | issue14898 messages |
| 2012年05月24日 10:41:01 | mark.dickinson | create |
|