typing: un-ignore parameter-already-assigned - #15308
Closed
deerred643-star wants to merge 1 commit into
Closed
deerred643-star wants to merge 1 commit into
deerred643-star wants to merge 1 commit into
Conversation
Closing this pull request as invalid@deerred643-star, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines. If you're facing any problem on how to mark a checkbox, please read the following instructions:
NOTE: Only |
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.
Un-ignores
parameter-already-assignedas part of thetygradual-typing baseline.ty check --exclude-scripts --error parameter-already-assignedon a synced Python 3.14 env reported exactly one diagnostic, inmachine_learning/k_means_clust.py:plt.axes(projection="3d")is annotated as returning the 2DAxes, whosescattersignature is(x, y, s=None, c=None, ...), so the third positional argument binds tosand collides withs=100. At runtime the object is anAxes3D, whose signature is(xs, ys, zs=0, zdir="z", s=20, c=None, ...), so the call is valid: this is a false positive caused by the imprecise static return type ofplt.axes, not a latentTypeError.The fix passes the third coordinate explicitly as
zs=, which is a positional-or-keyword parameter ofAxes3D.scatter. This keeps the runtime behaviour identical (verified by rendering the plot under theAggbackend before and after and comparing offsets, marker sizes, face colours and marker paths — byte-for-byte identical), and avoidsAny,cast, new imports, and suppression comments.With the diagnostic count at zero,
rules.parameter-already-assigned = "ignore"is removed from[tool.ty]. No other rule severity is touched.Validation
ty check --exclude-scripts:Found 5->Found 4diagnostics;parameter-already-assigned: 1 -> 0. The 4 remaining diagnostics are pre-existing (redundant-conditionx2,invalid-assignmentx2) and untouched.Found 50->Found 49;parameter-already-assigned: 1 -> 0.ruff check machine_learning/k_means_clust.py— all checks passedruff format --check machine_learning/k_means_clust.py— already formattedruff check pyproject.toml— all checks passedpytest --doctest-modules machine_learning/k_means_clust.py— 5 passedPart of #15187