Closed
Description
Describe the bug
Pyright shows several imports of tornado and typing as "is unknown import symbol", while such classes are present in actual libraries.
Such as:
x:x - error: "HTTPClientError" is not a known member of module (reportGeneralTypeIssues)
x:x - error: "_GenericAlias" is unknown import symbol (reportGeneralTypeIssues)
x:x - error: "_TypedDictMeta" is unknown import symbol (reportGeneralTypeIssues)
At least the HTTPClientError
has been in use since tornado version 5.1, and project I'm working on is using 6.0.2. Besides, tornado already has types, so why does it need typeshed?
To Reproduce
- create new virtual environemnt, activate it
$ python3 -m venv ./.venv
$ source ./.venv/bin/activate
- install tornado to the environment
$ python3 -m pip install tornado
- create new python file, import items listed from above. For example:
from typing import _GenericAlias, _TypedDictMeta
from tornado.httpclient import HTTPClientError
- run pyright to file which has imports from previous part.
$ pyright your_file.py
Expected behavior
Should run without "unknown import symbol"-errors
VS Code extension or command-line
I'm using comand-line tool.
After brief testing using pyright VS Code-extension it makes red squiggly lines under the same imports.
Additional context
#679 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment