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 for 3.12 type aliases #9813
Labels
feature request
This is a feature request.
Comments
I really doubt that this is needed. I'll let the rest decide on this |
Should be doable. It's a |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Discord 2.3.2 doesn't support python 3.12 type alises
What is the feature request for?
discord.ext.commands
The Problem
When creating aliases like this
MemberOrRole = Role | Member
The transformer has no issues
When creating aliases with the type statement, the transformer raises the error
unsupported type annotation
.type MemberOrRole = Role | Member
The only difference in this example is the statement.
The Ideal Solution
Being able to just use
type MemberOrRole = Role | Member
or more complex situations like
type NumberOrStringSequence [T: (int, float, str)] = Sequence[T]
The Current Solution
No response
Additional Context
The type statement for type aliases allows for generic type annotation, without the need for the typing module, and this greatly improves the coding experience for those that use 3.12. Just like mentioned on the PEP-695 it allows for declaring types, with constraints. That leads to a more controlled and readable environment.
The text was updated successfully, but these errors were encountered: