Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include type hints in function parameters #2233

Open
ldorigo opened this issue Sep 17, 2022 · 4 comments
Open

Include type hints in function parameters #2233

ldorigo opened this issue Sep 17, 2022 · 4 comments
Assignees
Labels
feature something new P3 not needed for current cycle

Comments

@ldorigo
Copy link

ldorigo commented Sep 17, 2022

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) .

@tuchandra
Copy link

Huge +1 from me; the developer experience of using a library that type hints its parameters is unmatched. There's some related work I've stumbled on:

@ajrheaume
Copy link

Type hints would be super useful! Any update about this feature request?

@Coding-with-Adam Coding-with-Adam added feature something new P3 not needed for current cycle labels Mar 22, 2024
@gvwilson
Copy link
Contributor

@T4rk1n will your work on the code generator take care of this as a side effect?

@T4rk1n
Copy link
Contributor

T4rk1n commented Jul 26, 2024

@T4rk1n will your work on the code generator take care of this as a side effect?

No, it is a task on it's own to add the typing to all API methods and then there is #2170 which are all typing related.

@gvwilson gvwilson changed the title [Feature Request] Include type hints in function parameters? Include type hints in function parameters Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

6 participants