flake8-bugbear icon indicating copy to clipboard operation
flake8-bugbear copied to clipboard

Consider adding alru_cache to B019

Open Stealthii opened this issue 1 year ago • 1 comments

The async-lru project provides a port for Python's built-in functools.lru_cache function for asyncio.

The same rules apply here with respect to garbage collection on instance methods. As this package is maintained by aio-libs it might be worth considering extending this rule to apply to uses of this decorator.

Stealthii avatar Aug 08 '24 12:08 Stealthii

I would accept checking for this in async def functions and recommending. As always, please add tests showing it working and ignoring edge cases etc. we decide not to support etc.

cooperlees avatar Aug 09 '24 01:08 cooperlees