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 asvetlov
Recipients asvetlov
Date 2018-12-26.00:26:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545783984.81.0.712150888896.issue35585@roundup.psfhosted.org>
In-reply-to
Content
Construction enums by-value (e.g. http.HTTPStatus(200)) performs two dict lookups: 
    if value in cls._value2member_map_:
        return cls._value2member_map_[value]

Changing the code to just
    return cls._value2member_map_[value]
with catching KeyError can speedup the fast path a little.
History
Date User Action Args
2018-12-26 00:26:27asvetlovsetrecipients: + asvetlov
2018-12-26 00:26:24asvetlovsetmessageid: <1545783984.81.0.712150888896.issue35585@roundup.psfhosted.org>
2018-12-26 00:26:24asvetlovlinkissue35585 messages
2018-12-26 00:26:24asvetlovcreate