Skip to content

Conversation

@wyattscarpenter
Copy link
Contributor

I intuit the previous author of this code sorted the codes for stability, but it actually should be in default order, to match what the user typed in. This will be more intuitive for the user.

In my first commit, I add the failing testUnusedIgnoreCodeOrder test. In my second commit, I fix the code.

@wyattscarpenter wyattscarpenter marked this pull request as ready for review October 9, 2025 10:59
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

scrapy (https://github.com/scrapy/scrapy)
- scrapy/squeues.py:28: error: Unused "type: ignore[misc, valid-type]" comment  [unused-ignore]
+ scrapy/squeues.py:28: error: Unused "type: ignore[valid-type, misc]" comment  [unused-ignore]
- scrapy/squeues.py:43: error: Unused "type: ignore[misc, valid-type]" comment  [unused-ignore]
+ scrapy/squeues.py:43: error: Unused "type: ignore[valid-type, misc]" comment  [unused-ignore]
- scrapy/squeues.py:77: error: Unused "type: ignore[misc, valid-type]" comment  [unused-ignore]
+ scrapy/squeues.py:77: error: Unused "type: ignore[valid-type, misc]" comment  [unused-ignore]
- scrapy/squeues.py:116: error: Unused "type: ignore[misc, valid-type]" comment  [unused-ignore]
+ scrapy/squeues.py:116: error: Unused "type: ignore[valid-type, misc]" comment  [unused-ignore]

setuptools (https://github.com/pypa/setuptools)
- setuptools/monkey.py:76: error: Unused "type: ignore[assignment, misc]" comment  [unused-ignore]
+ setuptools/monkey.py:76: error: Unused "type: ignore[misc, assignment]" comment  [unused-ignore]
- setuptools/monkey.py:85: error: Unused "type: ignore[assignment, misc]" comment  [unused-ignore]
+ setuptools/monkey.py:85: error: Unused "type: ignore[misc, assignment]" comment  [unused-ignore]
- setuptools/monkey.py:86: error: Unused "type: ignore[assignment, misc]" comment  [unused-ignore]
+ setuptools/monkey.py:86: error: Unused "type: ignore[misc, assignment]" comment  [unused-ignore]

pandas (https://github.com/pandas-dev/pandas)
- pandas/plotting/_matplotlib/hist.py:176: error: Unused "type: ignore[arg-type, index]" comment  [unused-ignore]
+ pandas/plotting/_matplotlib/hist.py:176: error: Unused "type: ignore[index, arg-type]" comment  [unused-ignore]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/internal/ci_visibility/coverage.py:41: error: Unused "type: ignore[assignment, misc]" comment  [unused-ignore]
+ ddtrace/internal/ci_visibility/coverage.py:41: error: Unused "type: ignore[misc, assignment]" comment  [unused-ignore]

pandera (https://github.com/pandera-dev/pandera)
- pandera/backends/pandas/error_formatters.py:126: error: Unused "type: ignore[assignment, call-overload]" comment  [unused-ignore]
+ pandera/backends/pandas/error_formatters.py:126: error: Unused "type: ignore[call-overload, assignment]" comment  [unused-ignore]

poetry (https://github.com/python-poetry/poetry)
- tests/console/commands/self/test_remove_plugins.py:40: error: Unused "type: ignore[call-arg, index, union-attr]" comment  [unused-ignore]
+ tests/console/commands/self/test_remove_plugins.py:40: error: Unused "type: ignore[index, union-attr, call-arg]" comment  [unused-ignore]

xarray (https://github.com/pydata/xarray)
- xarray/computation/weighted.py:185: error: Unused "type: ignore[arg-type, call-arg]" comment  [unused-ignore]
+ xarray/computation/weighted.py:185: error: Unused "type: ignore[call-arg, arg-type]" comment  [unused-ignore]

@A5rocks
Copy link
Collaborator

A5rocks commented Oct 10, 2025

I think your reconstruction of why it was sorted is correct based on this commit message: e883bba

@JelleZijlstra JelleZijlstra merged commit 5b7279b into python:master Oct 10, 2025
20 checks passed
@wyattscarpenter wyattscarpenter deleted the uec branch October 10, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants