Importing an entire google.cloud namespace package yields Unknown type, while specific imports are correctly typed #4507
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Describe the bug
Hey there, it's the guy with all the Google Cloud use cases.
In this case, my issue is that when importing a package from the
google.cloud
namespace, it is typed asUnknown
. If I then import a specific object from the same package, the specific object is appropriately typed.To Reproduce
Environment:
successful.py:
failing.py:
Output of
pyright success.py
:Output of
pyright failing.py
:Output of
pyright success.py failing.py
:It seems that any import in the entire Pyright process that accesses the specific object "unlocks" the type for the whole process.
Expected behavior
Whether importing the package as a whole, or particular objects from submodules, types should be built in the same way.
The text was updated successfully, but these errors were encountered: