Skip to content

Include type hints in function parameters #2233

@ldorigo

Description

@ldorigo

Hi,

Static type checkers (mypy, pyright/pylance) are becoming increasingly popular in the python world.
For now they don't work with Dash as there are no type annotations included with the library.

From what I understand, python code for dash components as well as their docstrings are somehow transpiled from javascript? If so, adding type hints should be relatively straightforward as it appears that the docstrings already contain very detailed typing information. This would significantly improve QOL for users using type checkers (which includes the majority of the vscode userbase since vscode uses pylance by default).

For reference, plotly has also started adding typing information to their functions - see for instance plotly/plotly.py#3425 (comment) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions