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 ethan.furman
Recipients CliffM, ethan.furman
Date 2013-10-14.00:07:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381709231.75.0.266440013316.issue19252@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure what you are talking about.  Here's the code:

    try:
        if value in cls._value2member_map_:
            return cls._value2member_map_[value]
    except TypeError:
        # not there, now do long search -- O(n) behavior
        for member in cls._member_map_.values():
            if member.value == value:
                return member

Here's the test:

    self.assertEqual(ColorInAList([1]), ColorInAList.red)

In order for that test to work, the first if (in the try) raises a TypeError, then execution falls into the except block and each member is tested for equality until one matches (via the if) -- so what is your added test doing that isn't already being done?
History
Date User Action Args
2013-10-14 00:07:11ethan.furmansetrecipients: + ethan.furman, CliffM
2013-10-14 00:07:11ethan.furmansetmessageid: <1381709231.75.0.266440013316.issue19252@psf.upfronthosting.co.za>
2013-10-14 00:07:11ethan.furmanlinkissue19252 messages
2013-10-14 00:07:11ethan.furmancreate