-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-39102: Increase Enum performance up to 10x times (3x average) #17669
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
cad12cc
Added class attributes access trough DynamicClassProperty (first atte…
Bobronium d6a48c3
Added class attributes access trough DynamicClassProperty (first atte…
Bobronium 923902e
Replaced dynamic attributes Enum.name and .value to instance attrs
Bobronium 8f2f90c
Improve values check speed (e.g. Color(3))
Bobronium ed43320
Replace tuples with sets for faster lookups
Bobronium 2c0372a
Used cls variable instead if multiple self.__class__
Bobronium cdc7041
Merge remote-tracking branch 'origin/fast-enum' into fast-enum
Bobronium 48d75d0
Fix whitespace in types
Bobronium ce84f10
📜🤖 Added by blurb_it.
blurb-it[bot] 0d1996f
Rename DynamicClassAttribute.__init__(name -> alias), add tests
Bobronium 2f6b977
DynamicClassAttribute.class_attr_name -> alias
Bobronium 1cedc4c
Use _unique_member_map_ instead of _member_names_ to store unique enu…
Bobronium 8304b6f
Use members dict instead of _member_names and _last_values on _EnumDict
Bobronium 4051208
Restore original formatting
Bobronium a90a4aa
Fix whitespaces
Bobronium 4436cbf
Use dict instead of list to check values in _create_pseudo_member_
Bobronium 45be0c6
Deprecate getting values through _value_ and _name_
Bobronium eabb7e3
Add 'name' and 'value' to Enum.__dir__
Bobronium fab4c97
Remove '_member_names' and return 'list(cls._unique_member_map_)' ins…
Bobronium 54e1eff
Use builtin dict() instead of _EnumDict for class creation
Bobronium 378dc88
Use f-strings instead of %s formatting
Bobronium ecd41fe
Fix missing '>' in repr, add test for that
Bobronium 948d3de
Add cache for repr, str and invert on Flag and IntFlag
Bobronium a668e2a
Remove redundant name and value setattr
Bobronium File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use
_repr_
cache here