Skip to content

Conversation

@JelleZijlstra
Copy link
Member

No backwards compatibility required because we never released
TypeExpr.

Also took the opportunity to expand the docstring.

No backwards compatibility required because we never released
TypeExpr.

Also took the opportunity to expand the docstring.
@JelleZijlstra
Copy link
Member Author

cc @davidfstr @erictraut

"""Special typing form used to represent a type expression.
@_TypeFormForm
def TypeForm(self, parameters):
"""A special typing construct to represent valid type expressions.

Choose a reason for hiding this comment

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

This phrasing is subtly confusing in the same way that earlier drafts of the PEP were. A TypeForm doesn't represent a type expression. It represents the set of runtime objects that encode the information in a type expression. This is the reason we moved away from the TypeExpr terminology. I recommend using the phrasing from the latest draft of the PEP. I tried hard to make that phrasing as clear as possible to avoid such confusion.

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, I rewrote the docstring to align with the Specification section of PEP 747.

@JelleZijlstra JelleZijlstra merged commit 08d866b into python:main Sep 28, 2024
20 checks passed
@JelleZijlstra JelleZijlstra deleted the typeform branch September 28, 2024 21:27
@davidfstr
Copy link
Contributor

Thanks @JelleZijlstra ! Getting typing_extensions.TypeExpr renamed to TypeForm was bullet ♯1 on my mypy implementation for this evening but I see you beat me to it!

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.

4 participants