-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
running ty check ty-issue-1135.py
raises a type error:
# ty-issue-1135.py
import dash
dropdown = dash.dcc.Dropdown(
id="dropdown",
options=list(range(5))
)
dropdown.id # error[unresolved-attribute] Type `Dropdown` has no attribute `id`
as @carljm proposed in astral-sh/ty#1135 (comment) since the body of classes like dash.dcc.Dropdown
is auto-generated
... it wouldn't be hard for dash to also generate a id
: typing.Optional[typing.Union[str, dict]]
annotation on the class body (not just in the__init__
signature) -- that would resolve the problem.
where the problem is that neither pyright
nor mypy
nor ty
understand the attributes present on dash.dcc.Dropdown
and other dash
classes