NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2398 most downloaded on PyPI
A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
Last release 4 days ago
30 Sep 2026
Release timing varies
gaps range from 3 weeks to 10 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
5 versions withdrawn
withdrawn after publishing
10 years old
76 releases · first in 2016
B008: resolve direct module-level imports and aliases when matching extend-immutable-calls
extend-immutable-calls (#252)series in for i, (ax, (series, name)) in enumerate(zip(axs, series)); the loop rebinds the top-level targets, not those names (#521){**d for d in ...} dict unpacking in comprehensions, new in Python 3.15; B035 no longer mistakes the unpacked expression for a static key+c * d continuation line that lost its parentheses (#452)ContextManager[T]; a generic base named like an exception, such as MyError[int], now counts (#538)One column per quarter.
B044: New check for assert <generator_expression> , which is always true
assert <generator_expression>, which is always true (#534)list(group) or tuple(group) back to the same name (#395)warnings.warn calls that pass an explicitly empty skip_file_prefixes tuple (#510)async_lru.alru_cache and check cache decorators on async def methods (#488)for self.a in self.b: rebinding an attribute is not rebinding the base name (#248)isinstance(x, int) without assigning or using the resultgroupby generator, and don't treat references in mutually exclusive if/elif/else branches as multiple uses (#465)abc.ABCMeta or enum.EnumMeta (#411)_ targets in zip() loops (#545)map() supports strict= (#548)B044: New check for assert <generator_expression>, which is always true (#534)
B031: allow reusing a group after assigning list(group) or tuple(group) back to the same name (#395)
B028: report warnings.warn calls that pass an explicitly empty skip_file_prefixes tuple (#510)
B019: also flag async_lru.alru_cache and check cache decorators on async def methods (#488)
B023: don't flag a function whose every reference is a direct call inside the loop body: such a function cannot outlive the iteration it was defined in (#468, #380)
B020: don't flag for self.a in self.b: rebinding an attribute is not rebinding the base name, so two different attributes of the same object are two bindings (#248)
B018: handle also useless calls such as isinstance(x, int) without assigning or using the result
B031: don't count a store-context reference (e.g. an annotation target like group: T) as a use of the groupby generator, and don't treat references in mutually exclusive if / elif / else branches as multiple uses while preserving warnings when the conditional can run repeatedly (#465)
B902: don't raise a false positive on a metaclass defined with a dotted base such as abc.ABCMeta or enum.EnumMeta (#411)
B913: Add an optional check for unused _ targets in zip() loops (#545)
B912: only emit on Python 3.14+ where map() supports strict= (#548)
Recursion errors raised during rules evaluation show a message instead of a raw traceback (#560)
B043: Add new check to state don't call delattr with constant
B042: New check for reminding to call super(). init in custom exceptions
map() without an explicit strict= parameter. (#516)B012 and B025 now also handle try/except*
B041: New dictionary same key AND value check
B910: implement to suggest using Counter() instead of defaultdict(int)
ContextVar with mutable literal or function call as defaultB909: Fix false positive affecting containers of mutables
B950: Add pragma comment to line length ignores
B902: Remove decorators named validator and root_validator from B902 checks
B038: Restrict rule to mutation functions only
B036: Fix crash on raise statements raising something other than
raise statements raising something other thanB038: Add check for mutations of loop iterator
B018: to detect useless-statements at all levels
B035: Fix false positive when named expressions are used
B035: add check for static keys in dict-comprehension
fix name collision for node_stack on python 3.12
Add B034: re.sub/subn/split must pass flags/count/maxsplit as keyword arguments.
Include tox.ini in MANIFEST.in for sdist.
Add B033: Detect duplicate items in sets
flake8-bugbear is now >= 3.8.1 project like flake8>=6.0.0
except a[0].b:)B030: Fix crash on certain unusual except handlers (e.g. except a[0].b: )
Add B033: Check for duplicate items in sets.
B950: now ignores 'noqa' and 'type: ignore' comments.
strip() method on an imported module.The ast.Bytes, ast.Num and ast.Str nodes are all deprecated, but may still be used by some codebases in order to maintain backwards compatibility with…
visit_Bytes, visit_Num and visit_Str to the list of visit_*
functions that are ignored by the B906 check. The ast.Bytes, ast.Num and
ast.Str nodes are all deprecated, but may still be used by some codebases in
order to maintain backwards compatibility with Python 3.7.except with an empty tuple i.e. except: ().B906: Add visit_Bytes , visit_Num and visit_Str to the list of visit_* functions that are ignored by the B906 check. The ast.Bytes , ast.Num and ast.Str nodes are all deprecated, but may still be used by some codebases in order to maintain backwards compatibility with Python 3.7.
B016: Warn when raising f-strings.
Add B028: Check for an explicit stacklevel keyword argument on the warn method from the warnings module.
Add B029: Check when trying to use except with an empty tuple i.e. except (): .
Add B030: Check that except handlers only use exception classes or tuples of exception classes. Fixes crash on some rare except handlers.
Add B031: Check that itertools.groupby() is not used multiple times.
Add B032: Check for possible unintentional type annotations instead of assignments.
B024: now ignores classes without any methods.
pytest.raises() has a match argument. (#334)visit_ functions with a _fields attribute that can't contain ast.AST subnodes. (#330)Rename B028 to B907, making it optional/opinionated.
Add B906: visit_ function with no further calls to a visit function.
visit_ function with no further calls to a visit function. (#313)!r when formatted value in f-string is surrounded by quotes. (#319)Add B905: zip() without an explicit strict= parameter.
zip() without an explicit strict= parameter. (#314)B027: Ignore @overload decorator
Make B015 and B018 messages slightly more polite
tox (#294)pyproject.toml package (#291)add B026: find argument unpacking after keyword argument
Add B025: Find duplicate except clauses
Add B024 error code to message for B024
Add B024: abstract base class with no abstract methods
Implement late-binding loop check
Don't crash when select / extend_select are None
Ignore black formatting for b013 test case
Ignore black formatting for b013 test case (#251)
B010 Fix lambda flase positive (#246)
B008 Fix edge case with lambda functions (#243)
B006 and B008: Detect function calls at any level of the default expression
B022: No arguments passed to contextlib.suppress
Build universal Python 3 wheels
B018: Disable strings from check for now
B904: ensure the raise is in the same context with the except
binascii.Error is now treated as a subclass of ValueError (#206)Fix crash on call in except statement in _to_name_str
Update B008: Whitelist more immutable function calls
raise without from in an except clause (#181)Verify the element in item_context.args is of type ast.Name for b017
Verify the element in item_context.args is of type ast.Name for b017
Add another hasattr() check to b017 visit for .func
Happy April Fools! This is no joke, it's a real release.
Happy April Fools! This is no joke, it's a real release.
Catching them all is bad!
Fix crash on tuple expansion in try/except block
Make sure float infinity/NaN does not trigger B008
Support exception aliases properly in B014
- Ignore keywords for B009/B010
Silence B009/B010 for non-identifiers
Refer to README.rst for changes.
Refer to README.rst for changes.
Refer to README.rst for changes.
Refer to README.rst for changes.
Allow continue/break within loops in finally clauses for B012
For B001, also check for except ():
Introduce B013 and B014 to check tuples in except (..., ): statements
Refer to README.md for changes.
Refer to README.md for changes.
Warn about continue/return/break in finally block (#100)
Removed a colon from the descriptive message in B008. (#96)
Refer to README.md for changes.
Refer to README.md for changes.
Fix .travis.yml syntax + add Python 3.8 + nightly tests
Fix black formatting + enforce via CI
Make B901 not apply to await methods
Refer to README.md for changes.
Refer to README.md for changes.
allow 'mcs' for metaclass classmethod first arg (PyCharm default)
Introduce B011
Introduce B009 and B010
Exclude immutable calls like tuple() and frozenset() from B008
For B902, the first argument for metaclass class methods can be "mcs", matching the name preferred by PyCharm.
Examine kw-only args for mutable defaults
black format all .py files
Examine kw-only args for mutable defaults
Test for Python 3.7
- packaging fixes
graduated to Production/Stable in trove classifiers
graduated to Production/Stable in trove classifiers
introduced B008
bugfix: Also check async functions for B006 + B902
Your coding agent can read these notes before it upgrades. Set up the MCP server →