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 wolma
Recipients wolma
Date 2014-07-16.21:43:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405547017.25.0.264801773086.issue21993@psf.upfronthosting.co.za>
In-reply-to
Content
>>> l = [False, True]
>>> l.index(True)
1
>>> l.index(False)
0

good, but:

>>> l = ['a', '', {}, 2.7, 1, 0, False, True]
>>> l.index(True)
4
>>> l.index(False)
5

Apparently, True and False get converted to int in comparisons to ints.
I would expect items to be compared either by:

a) object identity or
b) __eq__

but not this inconsistently.

Best,
Wolfgang
History
Date User Action Args
2014-07-16 21:43:37wolmasetrecipients: + wolma
2014-07-16 21:43:37wolmasetmessageid: <1405547017.25.0.264801773086.issue21993@psf.upfronthosting.co.za>
2014-07-16 21:43:37wolmalinkissue21993 messages
2014-07-16 21:43:37wolmacreate