-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-103921: Document PEP 695 #104642
gh-103921: Document PEP 695 #104642
Conversation
You could add this PEP to the release highlights: https://docs.python.org/3.12/whatsnew/3.12.html#summary-release-highlights |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like us to explicitly state somewhere that typing.TypeAliasType
is not the type of typing.TypeAlias
(and that in fact, they basically don't compose at all). I feel like this will inevitably cause confusion otherwise.
This allows :keyword:`type` to link to docs for the new `type` statement (being written in pythongh-104642) instead of to this header in the argparse docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than #104642 (comment) and one tiny last nit, this looks fantastic. Thanks for the huge amount of effort here, and for putting up with my many rounds of review!
Objects/typevarobject.c
Outdated
The latter example's signature is essentially the overloading\n\ | ||
of (str, str) -> str and (bytes, bytes) -> bytes. Also note\n\ | ||
that if the arguments are instances of some subclass of str,\n\ | ||
the return type is still plain str.\n\ | ||
\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think two line breaks are necessary here
\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
Also thanks for all the thorough reviews! I am going to merge this now so I can stop worrying about conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it's time :)
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit 060277d) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
GH-104989 is a backport of this pull request to the 3.12 branch. |
🎉 |
🥳🚀 |
(cherry picked from commit 060277d) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>. (cherry picked from commit 060277d) Co-authored-by: Jelle Zijlstra <[email protected]>
GH-105007 is a backport of this pull request to the 3.11 branch. |
|
||
Function and class definitions | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. class:: FunctionDef(name, args, body, decorator_list, returns, type_comment) | ||
.. class:: FunctionDef(name, type_params, args, body, decorator_list, returns, type_comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realised that type_params
is in the wrong place here for the AST as it currently exists on main
, where type_params
is at the end. But probably not worth fixing that until questions about the ABI are resolved in #104974.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, looks like you might have added type_params
to the constructor for FunctionDef
and ClassDef
, but not AsyncFunctionDef
!
Co-authored-by: Alex Waygood <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--104642.org.readthedocs.build/