Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

Fixes #17945

@github-actions
Copy link
Contributor

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

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/lib/column_config_utils_test.py:385:30: error: Invalid index type "str" for "Union[ColumnConfig, str, None]"; expected type "Union[SupportsIndex, slice]"  [index]
+ lib/tests/streamlit/elements/lib/column_config_utils_test.py:385:30: error: Invalid index type "str" for "str"; expected type "Union[SupportsIndex, slice]"  [index]

spack (https://github.com/spack/spack)
- lib/spack/spack/util/spack_yaml.py:490: error: Item "dict_items[Any, Any]" of "Iterator[tuple[Any, Any]] | dict_items[Any, Any] | enumerate[Any]" has no attribute "__next__"  [union-attr]

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@JukkaL JukkaL merged commit 539513a into python:master Oct 17, 2024
17 checks passed
@hauntsaninja hauntsaninja deleted the mypy-union-2 branch October 17, 2024 09:30
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Oct 18, 2024
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.

[1.12 regression] False positive when iterating over union

2 participants