What's new in Pylint 4.1.4?
Release date: 2026-11-14
False Positives Fixed
-
Fix a false positive for
using-constant-testwhen testing a method or function
whose decorator is unknown or is a class, such as a third-partycached_property.
astroid still infers such a method as a method, but the decorator may have turned
it into any other value.Closes #3484
-
Avoid
dict-init-mutatewhen an assignment's key or value references the dictionary being initialized.
Stop the suggested dictionary literal before later assignments that reference the dictionary.Closes #7997
-
Fixed a false positive for
unreachablewhen a terminating function call
(such assys.exit()) is inside a compound expression within a lambda body.Closes #8567
-
Fix a false positive for
used-before-assignmentwhen a class body uses a module-level or builtin name that a method or nested class defined later in the same class body shadows.Closes #9134
-
Fixed a false positive
undefined-variable(E0602) when a name annotated
without a value (x: int) is assigned with the walrus operator (:=) in
the condition of a comprehension spanning several lines, and used in its element.Closes #11647
-
Fix a false positive for
method-hiddenwhen a decorated method is inferred
as a property.Refs #11732
-
Fix false positives for
bad-dunder-nameon__prepare__,__mro_entries__,
__buffer__,__release_buffer__(Python 3.12+) and__replace__(Python 3.13+).Closes #11791
Other Bug Fixes
-
Pyreverse now reports a clear error instead of a traceback when
--classnames
an unknown class or module, or omits the module name when analyzing multiple modules.
Targets whose inferred values are all known not to be classes are also rejected.
If a target has several inferred values, Pyreverse uses the first class among them.Closes #22
-
Fix a crash when linting a package whose parent directory is an implicit namespace package
that also exists insite-packagesor the standard library: the module paths of the files inside it could not be
resolved, and the given package was reported without its package prefix.Closes #10278
-
Fix a crash in the logging checker when a logging call uses a
bytesformat string that is not valid UTF-8.Closes #10813
-
Fixed an
AssertionErrorcrash in the typecheck checker when accessing an attribute on anEnumexception instance.Closes #11638
-
Fixed a crash in
use-maxsplit-arg(C0207) when astr.split()or
str.rsplit()call indexed by a variable is used inside a loop that assigns
to a subscript, an attribute or an unpacked tuple (for exampleobj[0] = 1,
obj.attr = 1ora, b = 1, 2). Such targets have nonameattribute
and previously raisedAttributeError.The index variable is now also recognized as changed in the loop when it is
reassigned through tuple unpacking or an assignment expression (:=), which
removes a false positive.Refs #11676
-
--generate-toml-configand--generate-rcfilenow include the plugins given with
--load-pluginsor--enable-all-extensions.Closes #11699
-
Checkers loaded with
--load-pluginsorinit-hookare no longer registered twice in every
worker process, which used to emit each of their messages twice when--jobswas greater than 1.Closes #11701
Other Changes
-
Backslashes in message and option descriptions are now escaped in the generated
documentation and in--full-documentation, souse "\b" insteadno longer
renders asuse "b" instead.Closes #10737