Skip to content

Files

Latest commit

 

History

History
7 lines (4 loc) · 368 Bytes

lru-cache-decorating-method.md

File metadata and controls

7 lines (4 loc) · 368 Bytes

Pattern: Use of lru_cache method

Issue: -

Description

By decorating a method with lru_cache the self argument will be linked to the lru_cache function and therefore is never garbage collected. Unless your instance will never need to be garbage collected (singleton) it is recommended to refactor code to avoid this pattern or add a maxsize to the cache.