Skip to content

Add PEP 613 TypeAlias to typing_extensions #732

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

Merged
merged 5 commits into from
Jun 16, 2020

Conversation

east825
Copy link
Contributor

@east825 east825 commented Jun 9, 2020

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.

Thanks for doing this!

I'd like some positive tests (in the py2 and py3 versions) and I have some textual nits, then it's good to go.


Predicate = Callable[[...], bool] # type: TypeAlias

It's invalid when used anyhow but as in the example above.
Copy link
Member

Choose a reason for hiding this comment

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

anyhow but -> anywhere except


Predicate: TypeAlias = Callable[[...], bool]

It's invalid when used anyhow but as in the example above.
Copy link
Member

Choose a reason for hiding this comment

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

anyhow as -> anywhere except


Predicate: TypeAlias = Callable[[...], bool]

It's invalid when used anyhow but as in the example above.
Copy link
Member

Choose a reason for hiding this comment

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

(again)


Predicate: TypeAlias = Callable[[...], bool]

It's invalid when used anyhow but as in the example above.
Copy link
Member

Choose a reason for hiding this comment

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

(ditto)

@east825
Copy link
Contributor Author

east825 commented Jun 15, 2020

Oh, sorry, I missed the notifications.

I've added positive tests and fixed docstrings as suggested. Also, there happened to be a mistake in Callable syntax in the example (shame on me) and a few code style inconsistencies that I overlooked initially.

I pushed everything as individual commits to make the changes more evident as e.g. typeshed contributing guidelines require, let me know if I need to squash them manually.

@gvanrossum
Copy link
Member

@east825 Please don't squash, we do that when we merge. I am behind on code reviews, ping me later this week.

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.

Thanks! All good.

@gvanrossum gvanrossum merged commit 6d287f0 into python:master Jun 16, 2020
@east825 east825 deleted the PEP-613_typing_extensions.TypeAlias branch June 19, 2020 09:49
east825 added a commit to east825/typeshed that referenced this pull request Jun 19, 2020
At the moment this special marker annotation described in
PEP 613 exists only in typing_extensions module
(see python/typing#732).
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.

3 participants