Skip to content

Add some minimal support for PEP 612 in type stubs. #879

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 1 commit into from
Apr 2, 2021
Merged

Conversation

rchen152
Copy link
Contributor

@rchen152 rchen152 commented Apr 2, 2021

pytype will gracefully fall back to Any when typing.ParamSpec or
typing.Concatenate is used as the first argument to a Callable in a type stub,
allowing typeshed to start using most of PEP 612. Custom generic classes
parameterized with a ParamSpec are still not supported.

pytype was reporting weird [bad-unpacking] errors in parser.py, so I kept
adding ast3.AST annotations until they went away.

I also fixed a bug in PrintVisitor that caused it to print typing_extensions
imports as aliases rather than imports.

For #786.

PiperOrigin-RevId: 366342708

pytype will gracefully fall back to Any when typing.ParamSpec or
typing.Concatenate is used as the first argument to a Callable in a type stub,
allowing typeshed to start using most of PEP 612. Custom generic classes
parameterized with a ParamSpec are still not supported.

pytype was reporting weird [bad-unpacking] errors in parser.py, so I kept
adding ast3.AST annotations until they went away.

I also fixed a bug in PrintVisitor that caused it to print typing_extensions
imports as aliases rather than imports.

For #786.

PiperOrigin-RevId: 366342708
@google-cla google-cla bot added the cla: yes label Apr 2, 2021
@rchen152 rchen152 merged commit 69f02ef into master Apr 2, 2021
@rchen152 rchen152 deleted the google_sync branch April 2, 2021 01:08
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.

1 participant