Repository navigation
CI(deps): Update dependency pylint to v4.1.2 (main) - #7996
Merged
Merged
Conversation
…messages Pylint 4.1 reports R1716 (chained-comparison) and R0124 (comparison-with-itself). Rewrite the flagged conditions as chained comparisons, with unchanged logic, and use math.isnan() for the NaN checks in c_libraries_interface. Needed for the pylint update in #7996. Drafted with AI assistance (Claude Code); the changes are mechanical and were checked with pylint 4.1.1 and ruff.
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
echoix
reviewed
Oct 2, 2026
echoix
approved these changes
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.0.6→4.1.1Release Notes
pylint-dev/pylint (pylint)
v4.1.1Compare Source
What's new in Pylint 4.1.1?
Release date: 2026-09-29
Other Changes
Pylint 4.1.0 could not be uploaded to PyPI, because it required an unreleased
version of
dillon Python 3.15, and PyPI refuses such a dependency. 4.1.1 isthe first 4.1 release available on PyPI, see the 4.1.0 changes below.
Refs #11495
v4.0.10Compare Source
What's new in Pylint 4.0.10?
Release date: 2026-09-29
False Positives Fixed
Fix false positives for :ref:
unnecessary-lambdawhen a variable referenced inthe called expression is assigned, reassigned, or deleted later in the same scope.
Closes #8192
Fix a false positive for
unused-argumentin dataclass__new__methodswhen the arguments are consumed by a generated
__init__method.Closes #9843
Fix a false positive for
missing-kwoawhen keyword-only arguments are passedthrough a
**kwargsdictionary that is not a literal at the call site, forexample one filled with
options["key"] = valueafter its creation.Closes #10029
ungrouped-importsno longer reports imports inside mutually exclusiveOS guard branches (
if os.name == "nt":/if sys.platform == "win32":),matching the existing behavior for
sys.version_infoguards.Closes #10460
Other Bug Fixes
A
TypeErrorcrash could occur when checking aforloop thatiterates over a subscript with non-numeric constant bounds or a zero
step, e.g.
for a, b in {"k": [][0: ""]}.values():.Closes #11472
Fix a crash (
AttributeError: 'ClassDef' object has no attribute 'expr') in theimport-private-nameextension when an annotated assignment's value is anattribute access on a call rooted at a non-
Namenode, e.g.x: str = ''().a.Closes #11479
v4.0.9Compare Source
What's new in Pylint 4.0.9?
Release date: 2026-09-23
Security Fixes
to the cache directory (predictable
PYLINT_HOMEon a multi-user host) can nolonger write a crafted pickle that will runs arbitrary code when pylint access its
stat cache. The result cache is now stored as JSON instead of pickle,
preventing code-execution. The workaround is upgrading or not pointing
PYLINT_HOMEto an untrusted, shared, or group-writable directory. The default value,
~/.cache/pylint,is writable only by the user running pylint. (CVE with the same information pending)
False Positives Fixed
Fixed a false positive for
no-self-useon a method that only usesselfbefore a locally defined class (or other nested method), becausethe checker's could-be-a-function tracking state was not restored after
visiting the nested method.
Closes #3705
Fix a false positive for :ref:
not-callablewhen calling functions constructed withtypes.FunctionTypeortypes.LambdaType.Closes #7500
Fix a false positive for
unnecessary-direct-lambda-callwhen a directly calledlambda in a class body wraps a comprehension containing an assignment expression.
PEP 572 makes that a
SyntaxErrorwithout the lambda's scope, so following themessage produced code that would not compile.
Closes #9294
Fix a false positive for :ref:
unnecessary-ellipsiswhen an ellipsis is thesole body statement of a method defined on a
Protocol.Closes #9319
Fix a false positive for :ref:
bad-exception-causewhen the bases of the classbeing raised from cannot be inferred, such as an exception deriving from a
C extension class. :ref:
raising-non-exceptionand:ref:
catching-non-exceptionalready guard the sameinherit_from_std_exhelper with
has_known_bases.Refs #11399
False Negatives Fixed
method-hiddenis no longer silenced when the hidden method shares its name witha builtin function or with a function defined at module level. Only members of the
ancestor classes themselves can excuse the method now.
Refs #11361
Other Bug Fixes
Fix a block-scoped
# pylint: disable=directive placed inside anifbody leaking into sibling
elif/elseblocks for messages such asstop-iteration-return, which default to a line-based (rather thannode-based) message scope.
Closes #3136
Fix a false positive for
declare-non-slotwhen a class variable isannotated with
ClassVarwithout an initial value.Closes #9950
Fix a crash in the
no-memberchecker when attribute lookup raises anInferenceError.Closes #11356
Fix a crash in the
unnecessary-default-type-argscheck when aGeneratoror
AsyncGeneratorsubscript holds an empty tuple, such asGenerator[()].Closes #11357
Fix a crash in
method-hiddenwhen a method shadows a name thatbuiltinsbinds to a node without a statement, such as
helporlicense. Every classinherits from
object, which lives in thebuiltinsmodule, so no base classwas needed to trigger it.
Closes #11361
Closes #8079
v4.0.8Compare Source
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 modeargument that cannot be inferred.
Closes #10201
Fix a false positive for
invalid-name(C0103) on names assigned in anif __name__ == "__main__":block. Such a block reads like a script body, soa 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 asubclass of the expected builtin type, such as
selfin astrsubclass or anamedtuple.Closes #11306
Fix false positives for :ref:
bad-string-format-typewhen the argument is aninstance of a subclass of
int,floatorstr, such asboolor anIntEnummember formatted with%d.Closes #11315
False Negatives Fixed
redundant-unittest-assertnow also flagsassertEqualandassertNotEqualwhen 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
v4.0.7Compare Source
What's new in Pylint 4.0.7?
Release date: 2026-08-09
False Positives Fixed
Fix a false positive for
invalid-namewhen a module-level variable is assignedan instance of a
TypedDictsubclass. Such a name is a value, not a typedefinition, so it is now checked against the constant or variable regex instead
of
class-rgx.Closes #11231
Other Bug Fixes
Fix a crash in the
bad-open-modecheck when themodeargument ofopenis theNotImplementedconstant (Python >= 3.14).Closes #11099
Fix a crash in the
not-context-managerandnot-async-context-managerchecks when the context manager infers to a value without a name, such as the
slicereturned bywith slice(...)/async with slice(...).Closes #11102
Fix a false positive for
nested-min-max(W3301) when the innermin/maxcall carries a keyword argument such askey=. Flattening the call dropped the keyword and changed the result, so nested calls whose inner call has keyword arguments are no longer flagged.Closes #11130
Fix a false suggestion from
nested-min-max(W3301): when rewriting a nestedmin/maxinto a splat call, arguments positioned after the splatted call were silently dropped, so the suggested code changed the result.Closes #11134
Fix a false positive for
too-many-locals(R0914): PEP 695 type parameters, i.e. theT1andT2in a genericdef f[T1, T2]signature, were counted as local variables. They are type-system constructs, not runtime locals, and are now excluded from the local-variable count.Closes #11136
Fix
literal-comparison(R0123) emitting a corrupted suggestion for identifiersthat contain
is(e.g.axis is 5was renderedax== == 5). The suggestionis now rebuilt from the operands and operator.
Closes #11146
Fix false positives in
bad-string-format-type(E1307) for valid%formatting:%i/%uapplied to a float (both truncate like%d) and%aapplied to anynon-int type (
%ais type-agnostic like%s/%r).Closes #11147
Fix a false positive for :ref:
useless-parent-delegationwhen an override changesthe default value of a positional-only parameter.
Closes #11148
Fixed a crash in
comparison-with-callablewhen comparing a lambda assigned as a class attribute.Closes #11175
too-many-linescould be reported at the line of a# pylint: disable=too-many-linespragma found in a previously linted module. Pragma positions are now reset between
modules, so the message is reported at line 1 (or at the current module's own pragma)
regardless of which files were linted before.
Refs #11191
Fix a crash when a call unpacks a dictionary whose keys are not string
constants, e.g.
copy.copy(**{-1: 1}).Closes #11222
Configuration
📅 Schedule: (UTC)
* 0-3 1 * *)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.