Skip to content

cached_property for __slots__#2332

Merged
davidism merged 1 commit into
mainfrom
cached_property-slots
Feb 7, 2022
Merged

cached_property for __slots__#2332
davidism merged 1 commit into
mainfrom
cached_property-slots

Conversation

@davidism
Copy link
Copy Markdown
Member

@davidism davidism commented Feb 7, 2022

While working on #1753, some of the traceback module's classes used __slots__. I wanted to use cached_property and __slots__ at the same time, but cached_property relied on __dict__. Now, if a _cache_{name} slot is defined, a cached_property with that name will work.

@davidism davidism added this to the 2.1.0 milestone Feb 7, 2022
@davidism davidism force-pushed the cached_property-slots branch from e624595 to 87d5dd1 Compare February 7, 2022 15:42
@davidism davidism merged commit a04f5cc into main Feb 7, 2022
@davidism davidism deleted the cached_property-slots branch February 7, 2022 15:46
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant