Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] incorrect typing ofoptions inDropdown #3487

Open
Assignees
T4rk1n
Labels
P2considered for next cyclebugsomething broken
@mathause

Description

@mathause

Describe your context

dash                      3.2.0dash-bootstrap-components 2.0.4dash-extensions           2.0.4dash-svg                  0.0.12

Describe the bug

Passing a list-of-dict can be passed tooptions ofdcc.Dropdown but is not allowed by the types:

error:Argument "options" to "Dropdown" has incompatible type "list[dict[str, str]]"; expected "Sequence[str | SupportsFloat | SupportsInt | SupportsComplex | bool] | dict[Any, Any] | Sequence[Options] | None"  [arg-type]Found 1 error in 1 file (checked 1 source file)

Expected behavior

AllowSequence[dict[...]]

MVCE

# dropdown_tying.pyfromdashimportDash,dcc,html,Input,Output,callbackoptions= [       {'label':'New York City','value':'NYC'},       {'label':'Montreal','value':'MON'},       {'label':'San Francisco','value':'SF'},   ]app=Dash()app.layout=html.Div([dcc.Dropdown(options=options,value='NYC',id='demo-dropdown'),html.Div(id='dd-output-container')])@callback(Output('dd-output-container','children'),Input('demo-dropdown','value'))defupdate_output(value):returnf'You have selected{value}'if__name__=='__main__':app.run(debug=True)
mypy dropdown_tying.py

Metadata

Metadata

Assignees

Labels

P2considered for next cyclebugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp