What's new in Pylint 4.1.3?
Release date: 2026-10-11
False Positives Fixed
-
Fixed a false positive for
attribute-defined-outside-initwhen an
attribute is assigned inside the setter of an old-style, non-decorator
property(fget, fset)call. The decorator form (@property/
@x.setter) was already exempted by the fix for #409; the classic
call form was not.Closes #3325
-
Fix a false positive for
used-before-assignmentwhen a name bound by an earlier
target of the same assignment is used by a later target, as ina = b[a] = 0.Closes #5955
-
Fix a
no-memberfalse positive in a comprehension inside a branch that
cannot run, such asif sys.platform == "win32":on Linux. Like the rest of
the branch, the comprehension is no longer checked for missing members.Closes #7240
-
Fix a false positive for
used-before-assignmentwhen a name bound by a tuple
or list target of awithitem is used by a later item of the samewithstatement.Closes #7545
-
Fix false positives such as
not-callable,not-an-iterable,
unpacking-non-sequenceandno-memberon the result of a function whose
body is only..., like@overloadand.pyistubs. Such calls were
inferred as returningNone. This affectedsqlalchemy.func,
pydantic.Field, and thetorchfunctions wrapped by_add_docstr,
such astorch.linalg.qr. -
Fix a false positive for
protected-accesswhen a subclass of a subscripted
generic base, such asclass Child(Parent[T]), accesses a protected member
through that base, such asParent._foo(self).Closes #8600
-
Avoid emitting
unreachablefor ayieldimmediately afterraiseor
sys.exit()that marks a function as a generator, matching the existing
handling ofreturn.Closes #8909
-
Fix a false positive for
super-init-not-calledin.pyistub files, where
every__init__body is...and cannot call the parent's__init__.Closes #9096
-
Fix a false positive for
possibly-used-before-assignmentwhen a lambda
uses its parameters, including from a nested lambda, and that name is assigned
later in the module.Closes #9126
-
Fix a false positive for
useless-parent-delegationwhen a keyword-only
parameter is passed to the parent under the same keyword but with a different value.Closes #9226
-
Fix a false positive for
unused-argumentin.pyistub files, where
function bodies are...and cannot use their arguments.Closes #9417
-
Fix a false positive for
used-before-assignmentwhen a name assigned with an
assignment expression in the condition of a comprehension is used in its element,
for example[y for x in data if (y := f(x))].Closes #9460
-
Fixed false positive
arguments-differandsignature-differsfor
typing.overloadstubs. Overload stubs in a subclass are no longer compared
to the overridden method, and an overridden method with overloads is compared
through its implementation instead of its first stub. -
Stop emitting
redefined-variable-typewhen the bare_variable is
reused to discard values of different types.Closes #10374
-
Allow the
__main__module name in thecamelCase,PascalCaseand
UPPER_CASEnaming styles without reportinginvalid-name.Closes #10442
-
Fixed a false positive for
unexpected-keyword-argwhen a decorator that
returns its argument unchanged is stacked above a decorator accepting**kwargs.Closes #10831
-
Fix
invalid-namefalse positives for module-level all-caps aliases that
preserve the name of an external callable.Closes #11012
-
redefined-builtinno longer warns for method parameters that retain a
built-in name from an overridden method.Closes #11438
-
Fixed a false positive for
useless-suppressionofline-too-longwhen a#inside a string literal comes before the# pylint: disable=line-too-longcomment.Closes #11440
-
Fix a false positive for
unnecessary-ellipsiswhen an ellipsis is the
sole body statement of aProtocolmethod defined inside a conditional block
such asif TYPE_CHECKING:.Closes #11459
-
Fix a false positive for
unnecessary-negationwhen negating a comparison
between instances of asetorfrozensetsubclass.Refs #11513
Other Bug Fixes
-
Fix
pyreversehanging or crashing with aRecursionErrorwhen
--all-associated(-S) follows an attribute whose inferred class is rebuilt by
astroid on every inference, such as anumpyarray.Closes #3602
-
Fix a crash in
pyreversewhen a diagram includes a class created by
namedtuple, or anargparse.Namespace.Closes #10767
-
The "difference" column of the "Messages by category" and "Duplication" reports
(--reports=y) now shows the change since the previous run instead of repeating
the previous count.Closes #11520
-
Fixed
nested-min-maxsuggesting a non-equivalent rewrite when an inner
min/maxcall had multiple arguments.Refs #11593
-
Using several output formats that all write to stdout (for example
--output-format=colorized,no-header)
now raises an error instead of printing every message more than once.Closes #11597
-
Fixed an
IndexErrorcrash in the typecheck checker when anEnumclass defines an__init__method without arguments.Closes #11608
-
Fix a crash in the
duplicate-codechecker whenmin-similarity-linesis set to0.
The checker is now disabled in that case, as documented.Closes #11625