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