Skip to content
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

Support special TypeAlias in Python #2117

Open
oxisto opened this issue Mar 10, 2025 · 1 comment
Open

Support special TypeAlias in Python #2117

oxisto opened this issue Mar 10, 2025 · 1 comment
Labels

Comments

@oxisto
Copy link
Member

oxisto commented Mar 10, 2025

There seems to be a special class TypeAlias, which can be used to denote that something is a type alias. We should see how we can support this, because this is used all over the place in typings files.

FileDescriptor: TypeAlias = int  # stable

See https://docs.python.org/3/library/typing.html#typing.TypeAlias

@oxisto oxisto changed the title Support special TypeAlias Support special TypeAlias in Python Mar 10, 2025
@oxisto oxisto added the python label Mar 10, 2025
@oxisto
Copy link
Member Author

oxisto commented Mar 10, 2025

You gotta love python, this was introduced in 3.10 and is already deprecated since 3.12, but "it's not going away". Now there is a "type" keyword (which is the better option I think): https://docs.python.org/3/reference/simple_stmts.html#type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant