You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I was using wxPython for the first time so I tried to install 3rd party stubs to ease my task of learning it. I am using VSCode with Pylance as my language server.
The problem is that some modules in the wx package don't have a corresponding stub in the wx-stubs (meaning that they are missing). Since Pylance by default searches for the stubs first, it raises an Import could not be resolved error even though without the stubs the error disappears.
Since the stubs were working nicely for me. I don't want to uninstall them just for these errors. However, I read some pyright (used by pylance) documentation and they are saying that there isn't and won't be a configuration that allows falling back to the source files of the original library if the stubs are missing something. Moreover, the maintainers even recommend not using any incomplete stubs.
Do you propose any workaround to this problem besides completely removing the stubs?
edit: I just found the following PEP 561 link that explains partial packages. If a stub package distribution is partial it MUST include partial\n in a py.typed file.
Also this may be a useful related issue
The text was updated successfully, but these errors were encountered:
Hey I was using wxPython for the first time so I tried to install 3rd party stubs to ease my task of learning it. I am using VSCode with Pylance as my language server.
The problem is that some modules in the wx package don't have a corresponding stub in the wx-stubs (meaning that they are missing). Since Pylance by default searches for the stubs first, it raises an
Import could not be resolved
error even though without the stubs the error disappears.Since the stubs were working nicely for me. I don't want to uninstall them just for these errors. However, I read some pyright (used by pylance) documentation and they are saying that there isn't and won't be a configuration that allows falling back to the source files of the original library if the stubs are missing something. Moreover, the maintainers even recommend not using any incomplete stubs.
Do you propose any workaround to this problem besides completely removing the stubs?
edit: I just found the following PEP 561 link that explains partial packages.
If a stub package distribution is partial it MUST include partial\n in a py.typed file.
Also this may be a useful related issue
The text was updated successfully, but these errors were encountered: