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 Alexander Todorov
Recipients Alexander Todorov
Date 2017-03-08.14:03:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488981833.28.0.455455965624.issue29756@psf.upfronthosting.co.za>
In-reply-to
Content
When using list.count() I get the following results

    >>> [1, 2, 3].count(1)
    1
    >>> [1, 2, 3, True].count(2)
    1
    >>> [1, 2, 3, True].count(True)
    2
    >>> [1, 2, 3, True].count(1)
    2

as you can see True is considered the same as 1.  The documentation for the count method says:

    count(...)
        L.count(value) -> integer -- return number of occurrences of value

so IMO the above behavior is wrong. Seeing this on a RHEL 7 system with 
Python 3.5.1 and 2.7.5
History
Date User Action Args
2017-03-08 14:03:53Alexander Todorovsetrecipients: + Alexander Todorov
2017-03-08 14:03:53Alexander Todorovsetmessageid: <1488981833.28.0.455455965624.issue29756@psf.upfronthosting.co.za>
2017-03-08 14:03:53Alexander Todorovlinkissue29756 messages
2017-03-08 14:03:53Alexander Todorovcreate