-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Consider this code:
from csv import get_dialect
def foo(s: str):
dialect = get_dialect(s)
reveal_type(dialect)
mypy
reports
dialects.py:6: note: Revealed type is "_csv.Dialect"
One would expect the result would be csv.Dialect
.
There are 2 classes called Dialect
in typeshed:
Line 28 in 2480d7e
class Dialect: |
and
Line 61 in 2480d7e
class Dialect: |
get_dialect()
is imported in csv.pyi
from _csv.pyi
, so the declaration in _csv.pyi
is returning _csv.Dialect
instead of csv.Dialect
, so the type checkers see that as 2 separate classes.
Metadata
Metadata
Assignees
Labels
No labels