Second beta release of pylint 4.2.0, built on astroid 4.4.1.
Please try it on your code base and report any regression (crash, false positive, slowdown or memory increase) before 4.2.0 final:
pip install --pre pylint==4.2.0b1
Changes since 4.2.0b0
Behaviour changes worth testing:
- A
# pylint: disableor# pylint: enablepragma in the middle of a block no longer enables the message on the lines before it. (#3945) break-in-finallyandcontinue-in-finallyare now emitted when the statement is nested inside thefinallyclause (under anif, awith, or in atry/except*), matching theSyntaxWarningof Python 3.14.not-in-loopis now emitted for abreakorcontinueinside a loop'selseclause. (#11621)no-memberon name-mangled attributes: accessing a base class's private attribute through a subclass no longer warns,Child()._Child__valueis now flagged, andhasattr/ifguards now apply to these names. (#3879)
False positives fixed:
too-few-public-methodsfor classes inheriting from a base that cannot be inferred, such as a subscripted generic Pydantic model. (#10602)attribute-defined-outside-initwhen a base class cannot be inferred. (#3502)no-memberfor the named tuple API (_replace,_asdict,_fields...) onselfinside atyping.NamedTuplesubclass. (#4070)arguments-differ,arguments-renamedandsignature-differswith methods decorated by one of thesignature-mutators. (#5285)undefined-loop-variablefor a name used in a function's annotations or defaults that is also a loop variable in its body. (#5480)possibly-used-before-assignmentwhen a laterand-ed condition implies the guard that defined the variable. (#9662)not-an-iterableon a class attribute set toNonein one classmethod and to a list in another. (#10298)
False negatives fixed:
invalid-nameanddisallowed-namefor positional-only arguments. (#11897)unnecessary-lambdawith positional-only arguments. (#11904)deprecated-methodforglob.glob0()/glob.glob1()anddeprecated-classfortyping._UnionGenericAlias. (#11765)used-before-assignmentfor a name only assigned in anexceptblock paired withelse: continueinside a loop. (#9379)
Other bug fixes:
- Linting an explicit namespace package directory works again when an installed module with the same name shadows it. (#11902)
--jobs=0no longer runs a single process on cgroup v1 hosts. (#7338)- Fall back to a single process instead of crashing when a
ProcessPoolExecutorcannot be created. (#11674) protected-accessno longer flagsmod.Parent._foo(self), matchingParent._foo(self). (#11884)- Crash in the
magic-valueextension whenvalid-magic-valuescontains a malformed escape sequence. (#11892)
The full changelog will be published with 4.2.0.