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

Merge type annotation from typeshed #31

Closed
pmhahn opened this issue Jul 21, 2020 · 1 comment
Closed

Merge type annotation from typeshed #31

pmhahn opened this issue Jul 21, 2020 · 1 comment

Comments

@pmhahn
Copy link

pmhahn commented Jul 21, 2020

typeshed already carries type annotations for many "legacy" Python modules. As they evolve it becomes harder and harder to keep them synchronized. This becomes a non-issue if the type annotation is already included with the upstream source code and thus the typeshed is not needed at all.
It would be cool if com2ann had a mode to merge the annotations from typeshed into the source code of the module itself.

@gvanrossum
Copy link
Collaborator

I believe there’s a different tool in pyrope that can do this: https://github.com/google/pytype/blob/f30a091552a0a356538ad05ed4c994a7ba62bdf5/pytype/tools/merge_pyi/README.md

Note that this doesn’t solve all problems — type-checking the newly-annotated module will usually trigger a whole lot of errors that you’d have to fix manually.

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

No branches or pull requests

2 participants