-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Improve stubgen #1899
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
Improve stubgen #1899
Conversation
cae1030
to
6c0cd9c
Compare
Looks good! One thing might need some tweaking. We probably shouldn't infer
|
fbbb446
to
050343b
Compare
050343b
to
61f6a59
Compare
I've gone the easy way and simply infer |
It would still be nice to infer |
This reverts commit 61f6a59.
5ef9415
to
858cf50
Compare
Okay, added, not very pretty but a nicer way (not special case) would require some structural changes. |
Also added a test case about it. |
Thanks! |
Thanks! I'm confused though -- it seems to generate type annotations only
for arguments that have defaults?
|
Yeah, it would be nice to generate |
But what if the code is already annotated? Shouldn't that annotation just
be copied into the stub? We've been discussing use cases for such behavior.
|
That would be nice as well, but stubgen can't do that yet. I can create an issue for that. Also, for type checked code stubgen could run type checking to infer types, but it wouldn't be desirable for unannotated modules as this could result in type errors or even crashes. |
Add some type defaults to generated stubs.
For example
get typed as
Do not support ~complex cases like