From 77dc9920f424e3d942806d0bbda55e25745c6d07 Mon Sep 17 00:00:00 2001 From: Joe Young <80432516+jpy-git@users.noreply.github.com> Date: Mon, 21 Mar 2022 18:04:53 +0000 Subject: [PATCH] Tweak B019 desc (#237) --- README.rst | 2 +- bugbear.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1c628a8..3162a0e 100644 --- a/README.rst +++ b/README.rst @@ -132,7 +132,7 @@ data available in ``ex``. **B018**: Found useless expression. Either assign it to a variable or remove it. -**B019**: Use of ``functools.lru_cache`` or ``functools.cache`` on class methods +**B019**: Use of ``functools.lru_cache`` or ``functools.cache`` on methods can lead to memory leaks. The cache may retain instance references, preventing garbage collection. diff --git a/bugbear.py b/bugbear.py index 46c71d0..542bece 100644 --- a/bugbear.py +++ b/bugbear.py @@ -957,7 +957,7 @@ def visit(self, node): ) B019 = Error( message=( - "B019 Use of `functools.lru_cache` or `functools.cache` on class methods " + "B019 Use of `functools.lru_cache` or `functools.cache` on methods " "can lead to memory leaks. The cache may retain instance references, " "preventing garbage collection." )