Repository navigation
Releases: pylint-dev/pylint
Release list
v4.1.3
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
v4.1.2
What's new in Pylint 4.1.2?
Release date: 2026-10-03
False Positives Fixed
-
Fixed a false positive
unbalanced-tuple-unpackingwhen unpacking a tuple
concatenation whose elements have several possible values.Fixed by upgrading astroid to 4.3.3.
Closes #2621
Other Bug Fixes
-
Fixed a crash when calling
__bases__on a class.Fixed by upgrading astroid to 4.3.3.
Closes #11491
-
Fix a crash (
astroid-error) when the class of a called attribute cannot
be fully inferred, for example when the attribute is used as awith
statement target or inside a comprehension.Closes #11492
-
Fix a crash when a name bound by a
typestatement (a TypeVar) is used in awithstatement.Closes #11510
-
Fixed a crash (
TypeError) in the variables checker when checking a class
whose metaclass name binding has no line number, for example a class defined
withmetaclass=__annotations__.Closes #11511
-
Fix a crash in the
using-final-decorator-in-unsupported-versioncheck
whenimport finalis used.Closes #11521
-
Fix a crash when a plugin passes
confidence=Nonetoadd_message, as
pylint-pytestdoes, for a message that is disabled.confidence=Noneis
accepted again and meansUNDEFINED, like in pylint 4.0. Passing it
explicitly toadd_message,add_ignored_messageorMessagenow emits a
DeprecationWarning: it will raise an error in pylint 5.0.Closes #11530
v4.1.1
What's new in Pylint 4.1.1?
Release date: 2026-09-29
Other Changes
-
Pylint 4.1.0 could not be uploaded to PyPI, because it required an unreleased
version ofdillon Python 3.15, and PyPI refuses such a dependency. 4.1.1 is
the first 4.1 release available on PyPI, see the 4.1.0 changes below.Refs #11495
v4.1.0
What's new in Pylint 4.1.0?
Release date: 2026-09-29
Startup is about 25% faster thanks to lazy imports. The import checker caches
its isort configuration, which makes pylint about 17% faster on ansible.
Finding the files to lint with --recursive=y no longer walks ignored
directories such as .venv or node_modules, which took seconds on large
trees. The duplicate-code checker and symilar also received optimizations
that result in considerable performance improvements and memory use reduction
on larger codebases. For example, pandas analysis went from 20 min to 55 s and
pylint does not get OOM-killed when analyzing cpython anymore.
Python 3.15 support progresses: the unpacking in comprehensions added by
PEP 798 no longer raises false positives, and the standard library
deprecations of Python 3.15 are followed.
For CI, there is a new built-in junit output format
(--output-format=junit), the NO_COLOR and FORCE_COLOR environment
variables are respected, and the files to lint can now be set with the
files option in the configuration file.
New checks: looping-through-iterator, impossible-comparison,
chained-comparison-all-equal and
using-comprehension-unpacking-in-unsupported-version.
Running with --jobs no longer duplicates the messages of extensions or
ignores extensions enabled in the configuration.
Plugin authors: the confidence parameter can no longer be None, except
in is_message_enabled, and the MSG_STATE_* constants are deprecated in
favor of the MessageDisableReason enum.
The required astroid version is now 4.3.2. See the astroid changelog for additional fixes, features, and performance improvements applicable to pylint.
Breaking Changes
-
The
confidenceparameter is no longer nullable on any APIs except for
is_message_enabled(whereconfidence=Nonemeans "don't filter by
confidence"). The default becameinterfaces.UNDEFINED(an immutable value);
the behavior is unchanged unless you were passing an explicitNone. This
avoids a runtime check in multiple function to set the default value conditionally.The
constants.MSG_STATE_*integer were replaced by aMessageDisableReasonenum.
The old names remain as deprecated aliases pointing at the enum members.
MessageDisableReasonis anIntEnumso existing code comparing the return of
_get_message_state_scopeto the literal0/1/2keeps working.Refs #11018
New Features
-
Add support for
ignore-pattern-in-long-linesto allow ignoring specific parts of a line when checking line length.Refs #3352
-
Support for the
NO_COLORandFORCE_COLORenvironment variables has been added.
When running pylint, the reporter that writes to stdout is switched betweentext
andcolorizedaccording to the requested mode.
The order is:NO_COLOR>FORCE_COLOR>--output-format=....Closes #3995
-
The dict-init-mutate message now includes a suggested dictionary literal showing how to combine the initialization and subsequent mutations into a single statement.
Closes #7819
-
Add a built-in
junitoutput format (--output-format=junit) that produces JUnit-compatible XML output for CI/CD integration with Jenkins, Azure DevOps, GitLab CI, and GitHub Actions.Closes #9143
-
Trailing pragmas understood by other common tooling (
# type: ignore,
# pyright: ignore,# noqa,# pragma: no coverand
# pragma: no branch) are no longer counted toward the line length, so a line
is not flagged asline-too-longsolely because of such a pragma. This mirrors
the existing behaviour for Pylint's own# pylint:pragmas.Closes #10172
-
pyreverse: add
--no-signaturesto show method names without parameter lists or return type annotations in class diagrams.Closes #10772
-
Add support for
--known-first-partysimilar to--known-third-party.Refs #10803
New Checks
-
Added a new checker
looping-through-iterator(W4801) to detect when an iterator from an outer scope is consumed in a nested loop, which can lead to the iterator being unexpectedly exhausted.Refs #2996
-
Add new checks
impossible-comparisonandchained-comparison-all-equal.
impossible-comparisonflags boolean conditions whose chain of numeric
comparisons is logically contradictory and can never be true (for example
a > b and b > a).chained-comparison-all-equalflags boolean conditions
whose operands form a cycle of weak inequalities (<=or>=) and can be
simplified to a chain of equalities (for examplea >= b and b >= ais
equivalent toa == b).Closes #5814
-
Add
using-comprehension-unpacking-in-unsupported-version(W2607), emitted when
the code uses the unpacking in comprehensions added by PEP 798 while
py-versionstill includes a Python version that cannot compile it.Refs #10982
False Positives Fixed
-
Fix a false positive for
unnecessary-negation(C0117) when negating a
comparison between dict views (dict.keys()/dict.items()), which like
set/frozensetsupport only a partial (subset/superset) ordering, so
not a.items() <= b.items()is not equivalent toa.items() > b.items().Closes #3668
-
Fix false positives for
attribute-defined-outside-initwhere__init__
(etc.) uses a helper method to create attributes.Closes #5214
-
Fix a false positive for
consider-using-generatoranduse-a-generator
with an asynchronous list comprehension. Turning it into a generator expression
would create an asynchronous generator, which those functions cannot consume.Closes #7271
-
Fixed a false positive
assigning-non-slotwhen assigning to an inherited
descriptor through an instance returned by a method annotated with the
subclass. This regressed in pylint 3.0.0.Fixed by upgrading astroid to 4.1.0.
Closes #8053
-
Fixed a false positive
no-memberwhen aclassmethodannotated with
typing.Selfis overridden in a subclass and its result is used directly,
as inSubclass.build().only_on_subclass(). The return type is now narrowed
to the subclass rather than the base class. This regressed in pylint 3.0.0.Fixed by upgrading astroid to 4.1.0.
Closes #9159
-
Avoid emitting
deprecated-classfor imports inside a recognized
sys.version_infoguard.Closes #9533
-
Fix a false positive for
inconsistent-return-statementswhen an instance
method annotated withNoReturn(orNever) is called via the class
rather than an instance (e.g.MyClass.raise_method(obj)). The unbound
method form is now recognised as never returning, matching the existing
behaviour for the bound-method form.Closes #9692
-
Fix
used-before-assignmentfalse positive for names bound in only some arms of anif/elif/elsechain.Closes #9879
-
Fix a false positive for
useless-parent-delegationwhen a method overrides a
method of a C-level parent whose signature cannot be inspected, such as
Exception.__init__. BecauseException.__init__accepts*args, an
override taking onlyselfnarrows the accepted arguments and is not useless.
Overrides ofobject.__init__are still reported.Closes #9994
-
Fixed a false positive
no-name-in-modulewhen a module is imported with
an alias that shadows its base module and a function namedformatis
called on the alias.Fixed by upgrading astroid to 4.3.1.
Closes #10193
-
Fixed a false positive
unsubscriptable-objecton instances of a generic class defining__class_getitem__.Closes #10360
-
Fixed a false positive
unexpected-keyword-argumentwhen passingdtype
tonumpy.concatenate().Fixed by upgrading astroid to 4.3.1.
Closes #10548
-
Fix a false positive for
unexpected-keyword-argfor dataclasses
using generic type aliases (PEP 695).Closes #10703
-
Fix false positive
unreachablewhen calling a function with@overloadwhere one signature returnsNoReturn.Closes #10785
-
Fix a false positive for
too-many-function-argsfor dataclasses
using generic type aliases (PEP 695).Closes #10788
-
Fix a false positive
relative-beyond-top-levelerror when linting specific files in namespace packages in parallel mode by augmentingsys.pathbefore loading plugins and expanding files consistently for parallel workers.Closes #10794
-
Fix
# pylint: enableinside atryblock leaking into theexcept
handler. For example in the following code,no-memberis no longer
incorrectly re-enabled in theexceptblock:class Basket: # pylint: disable=no-member def pick(self): try: # pylint: enable=no-member print(self.apple) # no-member emitted here except KeyError: print(self.banana) # no-member NOT emitted here (correct)
Requires astroid 4.2.
Refs #10933
-
Fix false positives for the Python 3.15 syntax added by PEP 798, unpacking in
comprehensions:star-needs-assignment-target(E0114) was emitted for the unpacked element
of a comprehension, e.g.[*sub for sub in lists].consider-using-dict-comprehension(R1717) was emitted for
dict([*pairs for pairs in nested]), which flattens its argument and is
therefore not equivalent to a key/value dict comprehension.
Refs #1...
v4.0.10
What's new in Pylint 4.0.10?
Release date: 2026-09-29
False Positives Fixed
-
Fix false positives for :ref:
unnecessary-lambdawhen a variable referenced in
the called expression is assigned, reassigned, or deleted later in the same scope.Closes #8192
-
Fix a false positive for
unused-argumentin dataclass__new__methods
when the arguments are consumed by a generated__init__method.Closes #9843
-
Fix a false positive for
missing-kwoawhen keyword-only arguments are passed
through a**kwargsdictionary that is not a literal at the call site, for
example one filled withoptions["key"] = valueafter its creation.Closes #10029
-
ungrouped-importsno longer reports imports inside mutually exclusive
OS guard branches (if os.name == "nt":/if sys.platform == "win32":),
matching the existing behavior forsys.version_infoguards.Closes #10460
Other Bug Fixes
-
A
TypeErrorcrash could occur when checking aforloop that
iterates over a subscript with non-numeric constant bounds or a zero
step, e.g.for a, b in {"k": [][0: ""]}.values():.Closes #11472
-
Fix a crash (
AttributeError: 'ClassDef' object has no attribute 'expr') in the
import-private-nameextension when an annotated assignment's value is an
attribute access on a call rooted at a non-Namenode, e.g.x: str = ''().a.Closes #11479
v4.0.9
What's new in Pylint 4.0.9?
Release date: 2026-09-23
Security Fixes
- Someone without access to the configuration or linted code, but with access
to the cache directory (predictablePYLINT_HOMEon a multi-user host) can no
longer write a crafted pickle that will runs arbitrary code when pylint access its
stat cache. The result cache is now stored as JSON instead of pickle,
preventing code-execution. The workaround is upgrading or not pointingPYLINT_HOME
to an untrusted, shared, or group-writable directory. The default value,~/.cache/pylint,
is writable only by the user running pylint. (CVE with the same information pending)
False Positives Fixed
-
Fixed a false positive for
no-self-useon a method that only uses
selfbefore a locally defined class (or other nested method), because
the checker's could-be-a-function tracking state was not restored after
visiting the nested method.Closes #3705
-
Fix a false positive for :ref:
not-callablewhen calling functions constructed with
types.FunctionTypeortypes.LambdaType.Closes #7500
-
Fix a false positive for
unnecessary-direct-lambda-callwhen a directly called
lambda in a class body wraps a comprehension containing an assignment expression.
PEP 572 makes that aSyntaxErrorwithout the lambda's scope, so following the
message produced code that would not compile.Closes #9294
-
Fix a false positive for :ref:
unnecessary-ellipsiswhen an ellipsis is the
sole body statement of a method defined on aProtocol.Closes #9319
-
Fix a false positive for :ref:
bad-exception-causewhen the bases of the class
being raised from cannot be inferred, such as an exception deriving from a
C extension class. :ref:raising-non-exceptionand
:ref:catching-non-exceptionalready guard the sameinherit_from_std_ex
helper withhas_known_bases.Refs #11399
False Negatives Fixed
-
method-hiddenis no longer silenced when the hidden method shares its name with
a builtin function or with a function defined at module level. Only members of the
ancestor classes themselves can excuse the method now.Refs #11361
Other Bug Fixes
-
Fix a block-scoped
# pylint: disable=directive placed inside anif
body leaking into siblingelif/elseblocks for messages such as
stop-iteration-return, which default to a line-based (rather than
node-based) message scope.Closes #3136
-
Fix a false positive for
declare-non-slotwhen a class variable is
annotated withClassVarwithout an initial value.Closes #9950
-
Fix a crash in the
no-memberchecker when attribute lookup raises an
InferenceError.Closes #11356
-
Fix a crash in the
unnecessary-default-type-argscheck when aGenerator
orAsyncGeneratorsubscript holds an empty tuple, such asGenerator[()].Closes #11357
-
Fix a crash in
method-hiddenwhen a method shadows a name thatbuiltins
binds to a node without a statement, such ashelporlicense. Every class
inherits fromobject, which lives in thebuiltinsmodule, so no base class
was needed to trigger it.
v4.0.8
What's new in Pylint 4.0.8?
Release date: 2026-08-29
False Positives Fixed
-
Fix a false positive for :ref:
unspecified-encodingwhen anopencall uses a mode
argument that cannot be inferred.Closes #10201
-
Fix a false positive for
invalid-name(C0103) on names assigned in an
if __name__ == "__main__":block. Such a block reads like a script body, so
a name there is now accepted if it matches either the constant or the variable
naming style.Closes #10766
-
Fix false positives for :ref:
invalid-str-returned, :ref:invalid-repr-returned,
:ref:invalid-format-returned, :ref:invalid-bytes-returned, :ref:invalid-hash-returned,
:ref:invalid-index-returned, :ref:invalid-length-returned,
:ref:invalid-length-hint-returned, :ref:invalid-getnewargs-returnedand
:ref:invalid-getnewargs-ex-returnedwhen the returned value is an instance of a
subclass of the expected builtin type, such asselfin astrsubclass or a
namedtuple.Closes #11306
-
Fix false positives for :ref:
bad-string-format-typewhen the argument is an
instance of a subclass ofint,floatorstr, such asboolor an
IntEnummember formatted with%d.Closes #11315
False Negatives Fixed
-
redundant-unittest-assertnow also flagsassertEqualandassertNotEqual
when both compared values are constants, e.g.self.assertEqual(5, 5).Closes #11321
Other Bug Fixes
-
Fix a crash in the
docparamsextension when a raised name does not infer to an exception, such asraise sumorraise some_module. Such objects have noancestors(), which aborted the whole file with anastroid-errorfatal message.Closes #11228
-
Fix a crash in the
use-yield-fromchecker (AttributeError: 'Subscript' object has no attribute 'name') when a loop target is a subscript, attribute, or tuple.Closes #11286
-
Fix a crash in the
docparamsextension (AttributeError: 'AssignName' object has no attribute 'decorators') when a class has non-function attributes sharing the name of a property setter.Closes #11287
Other Changes
-
Upgrade the
isortupper bound soisort9 can be installed alongside pylint.Closes #11351
v4.0.7
What's new in Pylint 4.0.7?
Release date: 2026-08-09
False Positives Fixed
-
Fix a false positive for
invalid-namewhen a module-level variable is assigned
an instance of aTypedDictsubclass. Such a name is a value, not a type
definition, so it is now checked against the constant or variable regex instead
ofclass-rgx.Closes #11231
Other Bug Fixes
-
Fix a crash in the
bad-open-modecheck when themodeargument of
openis theNotImplementedconstant (Python >= 3.14).Closes #11099
-
Fix a crash in the
not-context-managerandnot-async-context-manager
checks when the context manager infers to a value without a name, such as the
slicereturned bywith slice(...)/async with slice(...).Closes #11102
-
Fix a false positive for
nested-min-max(W3301) when the innermin/maxcall carries a keyword argument such askey=. Flattening the call dropped the keyword and changed the result, so nested calls whose inner call has keyword arguments are no longer flagged.Closes #11130
-
Fix a false suggestion from
nested-min-max(W3301): when rewriting a nestedmin/maxinto a splat call, arguments positioned after the splatted call were silently dropped, so the suggested code changed the result.Closes #11134
-
Fix a false positive for
too-many-locals(R0914): PEP 695 type parameters, i.e. theT1andT2in a genericdef f[T1, T2]signature, were counted as local variables. They are type-system constructs, not runtime locals, and are now excluded from the local-variable count.Closes #11136
-
Fix
literal-comparison(R0123) emitting a corrupted suggestion for identifiers
that containis(e.g.axis is 5was renderedax== == 5). The suggestion
is now rebuilt from the operands and operator.Closes #11146
-
Fix false positives in
bad-string-format-type(E1307) for valid%formatting:
%i/%uapplied to a float (both truncate like%d) and%aapplied to any
non-int type (%ais type-agnostic like%s/%r).Closes #11147
-
Fix a false positive for :ref:
useless-parent-delegationwhen an override changes
the default value of a positional-only parameter.Closes #11148
-
Fixed a crash in
comparison-with-callablewhen comparing a lambda assigned as a class attribute.Closes #11175
-
too-many-linescould be reported at the line of a# pylint: disable=too-many-lines
pragma found in a previously linted module. Pragma positions are now reset between
modules, so the message is reported at line 1 (or at the current module's own pragma)
regardless of which files were linted before.Refs #11191
-
Fix a crash when a call unpacks a dictionary whose keys are not string
constants, e.g.copy.copy(**{-1: 1}).Closes #11222
v4.0.6
What's new in Pylint 4.0.6?
Release date: 2026-06-14
False Positives Fixed
-
implicit-str-concatis no longer emitted for an implicit concatenation of
a raw string with a non-raw one (e.g.r"\d" "\n"). Such literals cannot be
merged into a single string, so the concatenation is intentional rather than a
forgotten comma.Closes #6663
-
Fix a false positive for
invalid-name(C0103) where the default
typevar-rgxrejectedTypeVarnames containing digits, such as
Ec2T.Closes #8499
-
Fix a false positive for
too-many-argumentsin (non-static) methods and classmethods.Closes #8675
-
Fix a false positive for
no-memberwhen a value is inferred to several
possible types and at least one of them defines a dynamic__getattr__.Closes #9833
-
Fix a false positive for
function-redefined(E0102) when reusing names that
matchdummy-variables-rgx(such as_), which is common for
pytest-bddstep definitions. This restores the behavior from before pylint
4.0.0; as a consequence the false negative fixed in #9894 is reintroduced for
functions whose name matchesdummy-variables-rgx.Closes #10665
-
Fix
undefined-variablefalse positive when a name used as ametaclass
argument in a nested class is referenced again later in the module.Closes #10823
-
Fix a false positive for
unused-variablewhere global variables matching
dummy-variables-rgxwere still reported as unused when
allow-global-unused-variableswas disabled.Closes #10890
-
Fix a false positive for
bad-dunder-namewhen there is a user-defined__suppress_context__attribute on exception subclasses.Closes #10960
-
Fix
used-before-assignmentfalse positive for names bound byfrom X import *in every branch of anif/elif/elsechain.Refs #10980
-
Check for metaclass call signature when evaluating arguments of a class call.
Closes #11032
-
Fix false positive
method-hiddenwhencached_propertyis imported directly withfrom functools import cached_property.Refs #11037
Other Bug Fixes
-
Fix the suggestion of
unnecessary-comprehensionfor a dict comprehension
that iterates a dict directly, e.g.{a: b for a, b in d}. Iterating a dict
yields its keys, so the suggestion is nowdict(d.keys())instead of the
incorrectdict(d), which would simply copyd.Closes #8256
-
Fix a crash in
consider-using-enumeratewhen theforloop target is an attribute (e.g.for self.idx in range(len(x))) rather than a simple variable name.Closes #10099
-
Fix crash when checking
attribute-defined-outside-initon classes that inherit from a base class pylint cannot fully analyze.Closes #10892
-
Fix
add_messagesilently overwriting an explicitcol_offset=0(or any other zero-valuedline/end_lineno/end_col_offset) with the AST node's value. The internal_add_one_messagehelper used a falsey check (if not col_offset:) to detect an omitted argument, which incorrectly treated a legitimate0the same asNone. It now uses an identity check againstNone.Refs #11020
-
Fix a crash in the name checker when a non-constant value is passed as the
covariantorcontravariantargument of aTypeVar.Closes #11022
-
Fix a crash in the variable checker when a name resolves to a dataclass-synthesized
__init__, which has no line number.Closes #11023
-
Fix a crash in the variables checker when
NotImplementedis used as the test of anifstatement, which raised aTypeErrorin a boolean context on Python 3.14.Closes #11025
-
Avoided a crash from the implicit booleaness checker for
len()calls without arguments.Closes #11028
-
Fix a crash in the variables checker when a class declares a metaclass whose
attribute-access chain does not bottom out at a name (e.g.
class C(metaclass=None._)).
Originally reported aspylint-dev/astroid#3066.Refs #11031
-
Fix a crash in the name checker when a chained assignment of a
TypeAlias
value has a non-name target such as aSubscript(for example
a[0] = b = TypeAlias).Closes #11056
-
Fix a crash in the deprecated checker when
__import__is called with a
non-string constant argument (for example__import__(1)).Closes #11059
-
Avoid crashing when enum member inference fails while checking enum subclasses.
Closes #11069
-
Prevent a crash in
unexpected-keyword-arganalysis when
infer_call_result()raisesInferenceErrorwhile inspecting
decorator return signatures.Closes #11070
-
Fix a crash in the typecheck checker when a class uses a non-class object
(for example a function) as itsmetaclass=argument.Closes #11071
-
Allow digits in ParamSpec and TypeVarTuple names for
invalid-namecheck.The default
paramspec-rgxandtypevartuple-rgxpatterns rejected names
containing digits (e.g.Ec2P,S3Ts), emitting a falseinvalid-name
(C0103). Allow digits in the lowercase segments, consistent with the
typevarandtypealiaspatterns.Closes #11090
Performance Improvements
-
The duplicate-code checker no longer runs when its message (R0801) is disabled, even if
reports=yesis set. Previously, the checker's report (RP0801) would cause the expensive similarity computation to run regardless.Closes #3443
v4.0.5
What's new in Pylint 4.0.5?
Release date: 2026-02-20
False Positives Fixed
-
Fix possibly-used-before-assignment false positive when using self.fail() in tests.
Closes #10743
-
Fixed false positive for
logging-unsupported-formatwhen no arguments are provided to logging functions.According to Python's logging documentation, no formatting is performed when no arguments are supplied, so strings like
logging.error("%test")are valid.Closes #10752
-
Fix a false positive for
invalid-namewhere a dataclass field typed withFinal
was evaluated against theclass_constregex instead of theclass_attributeregex.Closes #10790
-
Avoid emitting
unspecified-encoding(W1514) whenpy-versionis 3.15+.Refs #10791