-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Added support to .pyi stubs. #502
Conversation
Some files changed for coordinate the name change. The script used.
Thanks for implementing this! A few quick notes:
|
Hi!
|
Originally I considered switching all stubs to use the .pyi extension, but it would have some pretty major drawbacks such as not getting syntax highlighting by default. So I'd like all mypy std library stubs in the repo to continue using the .py extension, but users would have the option of also using the .pyi extension. I think that the main use cases for .pyi are these:
Another option for the case with both a .py and a .pyi file would be to merge the files (i.e., use annotations from .pyi file to type check code in the .py file) but I think it could be somewhat painful to keep the two files in sync. We can reconsider this use case in the future, but I don't see any immediate need to support this. |
I've reverted the stubs extensions and added two simple tests. Also, I've changed the PR name. |
It looks good! |
Pull Request for #345 that now is in "priority"
I had to make some decisions, like that init.py don't change the extension, shouldn't be a stub, and python use it to know the modules.
Also, to allow import scripts, the script sometimes look just .pyi files, and other times look .py and .pyi (first .py).
If don't if that's the solution you want.