flake8-bugbear
flake8-bugbear copied to clipboard
Only emit B019 when `maxsize` is `None` in `lru_cache`?
Shouldn't B019 be emitted only when maxsize is None, as in https://github.com/PyCQA/pylint/pull/6181?
Not sure about this. With a bounded size it's true that the memory leak is bounded, but it's still true that you can leak a reference to a (potentially big) object this way.
JFYI , the mentions on this issue play out as a drama in three acts:
- Bugbear reported B019
- Seemed like a false positive ("transient memory leak seems fine") and was
noqad. - Actually was a true positive ("transient memory leak is actually problematic") and was fixed.
Seeing the noqa in code helped finding the root cause quickly.
+1 on closing this issue.