-
Or do I have to use stubgen for that? Also, if I do have to use stubgen for that, how would I get the generated type stubs to work with Pyright? |
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Mar 20, 2021
Replies: 1 comment
-
No, pyright's --createstub doesn't work with compiled modules. You'll need to use stubgen for that, but the amount of type information available in a compiled module is small, so the resulting stubs will be very low quality. You'll need to fill in a lot of information manually to make them work for type checking. In my experience, writing such stubs from scratch is a better approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
neelkarma
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, pyright's --createstub doesn't work with compiled modules. You'll need to use stubgen for that, but the amount of type information available in a compiled module is small, so the resulting stubs will be very low quality. You'll need to fill in a lot of information manually to make them work for type checking. In my experience, writing such stubs from scratch is a better approach.