You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
New changeset 34ae04f by Ethan Furman (Andrew Svetlov) in branch 'master':
Speed-up building enums by value, e.g. http.HTTPStatus(200) (bpo-11318) 34ae04f
New changeset 705b599 by Andrew Svetlov (Miss Islington (bot)) in branch '3.7':
Speed-up building enums by value, e.g. http.HTTPStatus(200) (GH-11318) (GH-11324) 705b599
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: