Skip to content

fix: var-annotated errors for iteration should point to the line where the variable is defined - #22324

Open
xixi-box wants to merge 1 commit into
python:masterfrom
xixi-box:fix/issue-22265-b3ab06a
Open

xixi-box wants to merge 1 commit into
python:masterfrom
xixi-box:fix/issue-22265-b3ab06a

Conversation

@xixi-box

Copy link
Copy Markdown

Fixes #22265

Root cause: var-annotated errors for iteration should point to the line where the variable is defined

Verified by running the failing test at b3ab06a32db2 (fails) and again with this patch applied (passes).

@xixi-box xixi-box changed the title fix: var-annotated errors for iteration should point to the line where the fix: var-annotated errors for iteration should point to the line where the variable is defined Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/collections.py:508: error: "None" object is not iterable  [misc]
+ src/prefect/utilities/collections.py:509: error: "None" object is not iterable  [misc]
- src/prefect/server/events/storage/__init__.py:80: error: "int" object is not iterable  [misc]
+ src/prefect/server/events/storage/__init__.py:88: error: "int" object is not iterable  [misc]

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/sql/datatypes.py:1794: error: Need type annotation for "mapper"  [var-annotated]
+ ibis/backends/sql/datatypes.py:1796: error: Need type annotation for "mapper"  [var-annotated]
- ibis/expr/types/strings.py:973: error: Need type annotation for "pattern"  [var-annotated]
+ ibis/expr/types/strings.py:975: error: Need type annotation for "pattern"  [var-annotated]
- ibis/expr/types/strings.py:1019: error: Need type annotation for "pattern"  [var-annotated]
+ ibis/expr/types/strings.py:1021: error: Need type annotation for "pattern"  [var-annotated]
- ibis/expr/types/relations.py:1141: error: Need type annotation for "arg"  [var-annotated]
+ ibis/expr/types/relations.py:1143: error: Need type annotation for "arg"  [var-annotated]

jax (https://github.com/google/jax)
- jax/_src/api_util.py:769: error: Need type annotation for "path"  [var-annotated]
+ jax/_src/api_util.py:771: error: Need type annotation for "path"  [var-annotated]

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/ext/doctest.py:443:9: error: Need type annotation for "node"  [var-annotated]
+ sphinx/ext/doctest.py:443:13: error: Need type annotation for "node"  [var-annotated]
- sphinx/versioning.py:43:5: error: Need type annotation for "node"  [var-annotated]
+ sphinx/versioning.py:43:9: error: Need type annotation for "node"  [var-annotated]
- sphinx/transforms/__init__.py:247:9: error: Need type annotation for "node"  [var-annotated]
+ sphinx/transforms/__init__.py:247:13: error: Need type annotation for "node"  [var-annotated]
- sphinx/transforms/__init__.py:289:9: error: Need type annotation for "node"  [var-annotated]
+ sphinx/transforms/__init__.py:289:13: error: Need type annotation for "node"  [var-annotated]
- sphinx/util/nodes.py:96:9: error: Need type annotation for "found"  [var-annotated]
+ sphinx/util/nodes.py:96:13: error: Need type annotation for "found"  [var-annotated]
- sphinx/util/nodes.py:331:5: error: Need type annotation for "node"  [var-annotated]
+ sphinx/util/nodes.py:331:9: error: Need type annotation for "node"  [var-annotated]

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.

var-annotated errors for iteration should point to the line where the variable is defined

1 participant

⌂ Proxy