diff --git a/README.rst b/README.rst index 406cd18..46d9256 100644 --- a/README.rst +++ b/README.rst @@ -273,7 +273,7 @@ on the first line and urls or paths that are on their own line:: "https://some-super-long-domain-name.com/with/some/very/long/paths" ) -**B910**: Use Counter() instead of defaultdict(int) to avoid memory leaks. Using the latter can result in using as much as ~1000 MB of memory even for small and simple dicts. Refactoring the code to use the former can reduce memory usage from mentioned ~1000 MB to flat ~20 MB. +**B910**: Use Counter() instead of defaultdict(int) to avoid excessive memory use as the default dict will record missing keys with the default value when accessed." How to enable opinionated warnings diff --git a/bugbear.py b/bugbear.py index e0f8218..a0b5d29 100644 --- a/bugbear.py +++ b/bugbear.py @@ -2392,7 +2392,7 @@ def visit_Lambda(self, node) -> None: ) ) B910 = Error( - message="B910 use Counter() instead of defaultdict(int) to avoid memory leaks" + message="B910 Use Counter() instead of defaultdict(int) to avoid excessive memory use" ) B950 = Error(message="B950 line too long ({} > {} characters)")