Skip to content

replace int | SupportsIndex with SupportsIndex#15389

Merged
srittau merged 3 commits intopython:mainfrom
guoci:int_SupportsIndex
Feb 9, 2026
Merged

replace int | SupportsIndex with SupportsIndex#15389
srittau merged 3 commits intopython:mainfrom
guoci:int_SupportsIndex

Conversation

@guoci
Copy link
Contributor

@guoci guoci commented Feb 7, 2026

No description provided.

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 7, 2026

I think we did this deliberately in the past because IDE users might find int | SupportsIndex easier to understand in tooltips than SupportsIndex (assuming the language server doesn't eagerly simplify the union — ty, for example, will eagerly simplify int | SupportsIndex to just SupportsIndex, at least at the moment)

@guoci
Copy link
Contributor Author

guoci commented Feb 7, 2026

Should we leave #15388 (comment) as int | SupportsIndex too?

@AlexWaygood
Copy link
Member

we're probably not very consistent one way or another right now. I don't have a strong opinion either way. We probably should try to be more consistent about things.

donbarbos added a commit to donbarbos/typeshed that referenced this pull request Feb 8, 2026
hauntsaninja pushed a commit that referenced this pull request Feb 8, 2026
Closes: #15390
Also also occurred in #15389
Previous issue on linux: #14886
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Let's standardize on SupportsIndex for now. If we want to list int explicitly, we should probably add a flake-pyi check to ensure we're consistent.

@srittau srittau merged commit da6e5e9 into python:main Feb 9, 2026
63 checks passed
@guoci guoci deleted the int_SupportsIndex branch February 9, 2026 15:42
@AlexWaygood
Copy link
Member

SGTM

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