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

PEP 647: Incorporated feedback from Guido about terminology and type relationship between bool and TypeGuard #1765

Merged
merged 15 commits into from Jan 16, 2021

Conversation

erictraut
Copy link
Contributor

No description provided.

Copy link
Member

@gvanrossum gvanrossum left a 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor Author

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.

Copy link
Member

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

@gvanrossum gvanrossum merged commit 28fc05c into python:master Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants