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

Python type hints #19480

Closed
RussTedrake opened this issue May 24, 2023 · 4 comments
Closed

Python type hints #19480

RussTedrake opened this issue May 24, 2023 · 4 comments
Assignees
Labels
component: pydrake Python API and its supporting Starlark macros priority: low type: feature request

Comments

@RussTedrake
Copy link
Contributor

A number of users have requested that our python bindings/code use Python type hints. I'm opening this feature request to track it.

Related to #18452. I hear this often in feedback from students.

Tagging @EricCousineau-TRI as component owner.

@jwnimmer-tri
Copy link
Collaborator

To my understanding, the *.pyi files that we install already have this. Here's a pyi snippet from symbolic.pyi:

class Expression:
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(self, constant: float) -> None: ...
    @overload
    def __init__(self, var: Variable) -> None: ...

Could you more precisely clarify what isn't working?

@jwnimmer-tri
Copy link
Collaborator

Maybe the request is that the small handful of public code that is pure Python (e.g., VideoWriter) add the type hints?

@RussTedrake
Copy link
Contributor Author

I've asked @buoyancy99 to weigh in. He was one of the most vocal advocates.

@RussTedrake
Copy link
Contributor Author

I talked to @buoyancy99 f2f and he said the solution that's already in place is great! Sorry I didn't realize it. Based on the original intention, I will close this (but I agree it could be good to add the type hints to our python code, so please re-open if you wish to track that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pydrake Python API and its supporting Starlark macros priority: low type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants