Skip to content
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

Using @cached_property to cache @property calls. #1734

Closed
wants to merge 1 commit into from

Conversation

ancestor-mithril
Copy link
Contributor

@ancestor-mithril ancestor-mithril commented Oct 10, 2023

@cached_property works like @property combined with @lru_cache, but it caches the result only once and it assumes it never changes (the internal state of the class is not modified in the meantime).
I also assume that the internal state of LabelManager and ConfigurationManager does not change after creation, please correct me if I'm wrong.

@FabianIsensee FabianIsensee self-assigned this Oct 10, 2023
@FabianIsensee
Copy link
Member

Hey I would prefer to leave it as is because should I ever decide to fiddle with these classes having @cached_property might cause some really obscure bugs that will be difficult to find

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants