What's New in Pylint 4.2¶
:Release:4.2 :Date: TBA
Summary -- Release highlights¶
What's new in Pylint 4.2.0?¶
Release date: TBA
New Features¶
False Positives Fixed¶
Fix
unused-importfalse positives for names used only in themetaclass=argument of a class defined inside another class or inside a block such as anif, or within a more complex expression like a conditional expression, a call argument, a lambda or a comprehension. A name already used before such a class is also no longer reported asundefined-variablewhen the metaclass cannot be inferred. The names of a class body are no longer resolved from the metaclass of a class defined in one of its methods, where they are not visible:undefined-variableis now reported for them, as for the bases.Closes #1630 (#1630)
Fixed a false positive for
arguments-differwhen an overriding method declares a parameter as positional-only (/) that is a regular parameter in the overridden method. Positional-only parameters are now counted as positional parameters in the comparison.Closes #11567 (#11567)
False Negatives Fixed¶
Report
used-before-assignmentwhen a bare type annotation masks assignments that may not execute intry,except, orfinallycontrol flow.Closes #10847 (#10847)
Other Bug Fixes¶
The MermaidJS output of
pyreversenow honours--module-names=y: each class is labelled with its module-qualified name, as the dot and PlantUML outputs already were.Closes #10164 (#10164)
Other Changes¶
Document TOML escaping and the reserved backslashes in the ignore-paths option.
Closes #6963 (#6963)
Fix the programmatic
run_pylintexample to pass command-line arguments as a sequence.Closes #8766 (#8766)
Clarify the distinction between the built-in design checker and the optional McCabe extension, including how to disable their messages individually.
Fixes part of #9174 (#9174)
Document the
no-headeroutput format and the use of a custom reporter class with--output-format.Closes #11595 (#11595)
Remove support for launching pylint with Python 3.10. Code that supports Python 3.10 can still be linted with the
--py-version=3.10setting.Refs #11643 (#11643)