github pylint-dev/pylint v4.2.0b1

pre-releaseone hour ago

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: disable or # pylint: enable pragma in the middle of a block no longer enables the message on the lines before it. (#3945)
  • break-in-finally and continue-in-finally are now emitted when the statement is nested inside the finally clause (under an if, a with, or in a try/except*), matching the SyntaxWarning of Python 3.14. not-in-loop is now emitted for a break or continue inside a loop's else clause. (#11621)
  • no-member on name-mangled attributes: accessing a base class's private attribute through a subclass no longer warns, Child()._Child__value is now flagged, and hasattr/if guards now apply to these names. (#3879)

False positives fixed:

  • too-few-public-methods for classes inheriting from a base that cannot be inferred, such as a subscripted generic Pydantic model. (#10602)
  • attribute-defined-outside-init when a base class cannot be inferred. (#3502)
  • no-member for the named tuple API (_replace, _asdict, _fields...) on self inside a typing.NamedTuple subclass. (#4070)
  • arguments-differ, arguments-renamed and signature-differs with methods decorated by one of the signature-mutators. (#5285)
  • undefined-loop-variable for a name used in a function's annotations or defaults that is also a loop variable in its body. (#5480)
  • possibly-used-before-assignment when a later and-ed condition implies the guard that defined the variable. (#9662)
  • not-an-iterable on a class attribute set to None in one classmethod and to a list in another. (#10298)

False negatives fixed:

  • invalid-name and disallowed-name for positional-only arguments. (#11897)
  • unnecessary-lambda with positional-only arguments. (#11904)
  • deprecated-method for glob.glob0()/glob.glob1() and deprecated-class for typing._UnionGenericAlias. (#11765)
  • used-before-assignment for a name only assigned in an except block paired with else: continue inside 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=0 no longer runs a single process on cgroup v1 hosts. (#7338)
  • Fall back to a single process instead of crashing when a ProcessPoolExecutor cannot be created. (#11674)
  • protected-access no longer flags mod.Parent._foo(self), matching Parent._foo(self). (#11884)
  • Crash in the magic-value extension when valid-magic-values contains a malformed escape sequence. (#11892)

The full changelog will be published with 4.2.0.

Don't miss a new pylint release

NewReleases is sending notifications on new releases.