Skip to content

Commit

Permalink
Fixed text and description of B910
Browse files Browse the repository at this point in the history
  • Loading branch information
djvdq committed Aug 17, 2024
1 parent faeef39 commit 3caa1b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)")

Expand Down

0 comments on commit 3caa1b9

Please sign in to comment.