Skip to content
Commit dba8df11 authored by Mathieu Kniewallner's avatar Mathieu Kniewallner Committed by Randy Döring
Browse files

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`.
parent c66178a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment