Skip to content

generic GenericAlias #13941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jorenham
Copy link
Contributor

@jorenham jorenham commented May 4, 2025

I suppose that theoretically speaking (i.e. ignoring type-checkers), this brings support for higher-kinded typing 🤔.

Copy link
Contributor

github-actions bot commented May 4, 2025

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

pydantic (https://github.com/pydantic/pydantic)
- pydantic/v1/typing.py:47: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "type[GenericAlias]")  [assignment]
+ pydantic/v1/typing.py:47: error: Incompatible types in assignment (expression has type "tuple[()]", variable has type "type[GenericAlias[_OriginT_co]]")  [assignment]

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/converter.py:1119: error: Return type "Greedy[T]" of "__class_getitem__" incompatible with return type "GenericAlias" in supertype "list"  [override]
+ discord/ext/commands/converter.py:1119: error: Return type "Greedy[T]" of "__class_getitem__" incompatible with return type "GenericAlias[type | TypeAliasType]" in supertype "list"  [override]

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 participant