Skip to content

[3.11] [Enum] store members in class dict; comment out tests #94392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ethanfurman
Copy link
Member

No description provided.

@@ -648,6 +648,10 @@ def __new__(metacls, cls, bases, classdict, *, boundary=None, _simple=False, **k
% (enum_class._member_names_, _order_)
)
#
# store members in class dict for performance
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that matters.

@@ -648,6 +648,10 @@ def __new__(metacls, cls, bases, classdict, *, boundary=None, _simple=False, **k
% (enum_class._member_names_, _order_)
)
#
# store members in class dict for performance
for name, member in enum_class._member_map_.items():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below changes are a different project, but have no bearing on the tests.

@mdboom
Copy link
Contributor

mdboom commented Jul 1, 2022

Pyperformance benchmark results

Basically "same", which isn't surprising, given that none of the benchmarks spend significant time in enums.

@ethanfurman ethanfurman deleted the enum-fast branch July 17, 2022 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants