-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ensure garbage collection of objects using lru cache
Decorating class instances methods using `lru_cache` prevents garbage collection to happen when an object gets deleted. This could be really bad for memory consumption. Some resources about this: - https://rednafi.github.io/reflections/dont-wrap-instance-methods-with-functoolslru_cache-decorator-in-python.html - https://www.youtube.com/watch?v=sVjtp6tGo0g Originally spotted by rule `B019` of `flake8-bugbear`.
- Loading branch information
1 parent
c66178a
commit dba8df1
Showing
2 changed files
with
8 additions
and
6 deletions.
There are no files selected for viewing
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