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
PEP 647: Incorporated feedback from Guido about terminology and type relationship between bool and TypeGuard #1765
Conversation
…w section to "Rejected Ideas" section about conditional application of the TypeGuard type.
…th "positional" when referring to argument) and clarified the type relationship between bool and TypeGuard.
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.
One nit.
PS. What's up with your tooling? Each PR you submit repeats all the commits you ever made to this file.
pep-0647.rst
Outdated
allows for a single type argument. It is meant to be used to annotate the | ||
return type of a function or method. When it is used in other contexts, it | ||
is treated as a ``bool``. | ||
module. ``TypeGuard`` is a generic type that accepts a single type argument. |
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.
module. ``TypeGuard`` is a generic type that accepts a single type argument. | |
module. ``TypeGuard`` is a special form that accepts a single type argument. |
I propose to use "special form" instead of "generic type" since the functionality cannot be emulated using a user-defined generic type (same as for Union, Tuple etc.). I don't recall whether "special form" is a technical term defined in PEP 484, but we do use it in typing.py.
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.
PEP 484 doesn't define the term "special form", but the change sounds reasonable to me.
Not sure why github is repeating all of my prior commits when it creates the PR.
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.
Resolved the conflict.
I think the odd appearance of the PR is because you are working on master instead of creating a branch for each PR.
No description provided.