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

gh-103921: Document PEP 695 #104642

Merged
merged 69 commits into from May 26, 2023
Merged

gh-103921: Document PEP 695 #104642

merged 69 commits into from May 26, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 19, 2023

@bedevere-bot bedevere-bot mentioned this pull request May 19, 2023
9 tasks
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label May 19, 2023
@hugovk
Copy link
Member

hugovk commented May 19, 2023

You could add this PEP to the release highlights: https://docs.python.org/3.12/whatsnew/3.12.html#summary-release-highlights

Copy link
Member

@AlexWaygood AlexWaygood left a 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.

JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request May 19, 2023
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.
JelleZijlstra added a commit that referenced this pull request May 19, 2023
This allows :keyword:`type` to link to docs for the new `type`
statement (being written in gh-104642) instead of to this header
in the argparse docs.
Doc/library/ast.rst Outdated Show resolved Hide resolved
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misc comments from skimming through the whole thing again and looking at the docs build preview

Doc/library/dis.rst Outdated Show resolved Hide resolved
Doc/library/dis.rst Outdated Show resolved Hide resolved
Doc/library/dis.rst Outdated Show resolved Hide resolved
Doc/library/typing.rst Outdated Show resolved Hide resolved
Doc/library/typing.rst Show resolved Hide resolved
Doc/reference/compound_stmts.rst Outdated Show resolved Hide resolved
Doc/reference/executionmodel.rst Outdated Show resolved Hide resolved
Doc/reference/executionmodel.rst Outdated Show resolved Hide resolved
Doc/reference/simple_stmts.rst Outdated Show resolved Hide resolved
Doc/reference/simple_stmts.rst Outdated Show resolved Hide resolved
Objects/typevarobject.c Outdated Show resolved Hide resolved
Objects/typevarobject.c Outdated Show resolved Hide resolved
Objects/typevarobject.c Outdated Show resolved Hide resolved
Objects/typevarobject.c Show resolved Hide resolved
Copy link
Member

@AlexWaygood AlexWaygood left a 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!

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\
Copy link
Member

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

Suggested change
\n\

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it's time :)

@JelleZijlstra JelleZijlstra merged commit 060277d into python:main May 26, 2023
21 checks passed
@miss-islington
Copy link
Contributor

Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@JelleZijlstra JelleZijlstra deleted the pep695docs branch May 26, 2023 17:48
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 26, 2023
(cherry picked from commit 060277d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-bot
Copy link

GH-104989 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label May 26, 2023
@carljm
Copy link
Member

carljm commented May 26, 2023

🎉

@AlexWaygood
Copy link
Member

🥳🚀

JelleZijlstra added a commit that referenced this pull request May 26, 2023
(cherry picked from commit 060277d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request May 27, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>.
(cherry picked from commit 060277d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-bot
Copy link

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)
Copy link
Member

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.

Copy link
Member

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!

JelleZijlstra added a commit that referenced this pull request May 27, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news topic-typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants