Skip to content

Comments

Make types.UnionType.__getitem__ parameter positional-only#15458

Merged
srittau merged 1 commit intopython:mainfrom
brianschubert:stdlib-uniontype-posonly
Feb 23, 2026
Merged

Make types.UnionType.__getitem__ parameter positional-only#15458
srittau merged 1 commit intopython:mainfrom
brianschubert:stdlib-uniontype-posonly

Conversation

@brianschubert
Copy link
Collaborator

New hit from running stubtest with python/mypy#19593, introduced in #14687

For reference:

>>> (int | list[T]).__getitem__(parameters=int)
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    (int | list[T]).__getitem__(parameters=int)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: wrapper __getitem__() takes no keyword arguments

@github-actions
Copy link
Contributor

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

@srittau srittau merged commit 2b36c45 into python:main Feb 23, 2026
51 checks passed
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