-
-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Description
What happened:
When type-checking a program that imports from distributed with pyright, an error is accused:
# foo.py
from distributed import Client
print(Client)pyright foo.py
...
/tmp/test-area/foo.py:1:25 - error: "Client" is not exported from module "distributed"
Import from "distributed.client" instead (reportPrivateImportUsage)
1 error, 0 warnings, 0 informations
What you expected to happen:
I expect the package to be correctly typed, following PEP 484
Anything else we need to know?:
PEP 484 states that
Modules and variables imported into the stub are not considered exported from the stub unless the import uses the
import ... as ... formor the equivalentfrom ... import ... as ... form
and Pyright follows this guideline, although mypy doesn't.
Environment:
- Dask version: 2022.8.0
- Python version: 3.10.5
- Operating System: Arch linux
- Install method (conda, pip, source): pip inside an environment
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels