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

Better typings #976

Open
mateusz-lichota opened this issue Jul 22, 2022 · 2 comments
Open

Better typings #976

mateusz-lichota opened this issue Jul 22, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@mateusz-lichota
Copy link

mateusz-lichota commented Jul 22, 2022

Currently using rclpy in intended ways causes typing errors due to partially unknown types of multiple methods. Even the simplest functionality (creating a publisher or a subscription) does not typecheck (tested using pylance). I've written much better typing stubs for myself, including making rclpy Subscription and Publisher generic over the mesage type, and Future generic over the return type. Would it be a welcome change to this repo to add those improved typings? Those are not evaluated at runtime, so they can't break existing code, but it would greatly improve the experience for anyone using static type checking

@apockill
Copy link
Contributor

I would personally quite appreciate Subscription/Publisher/Future generics!

This was referenced Jul 23, 2022
@ros-discourse
Copy link

This issue has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/python-type-checking-in-ros2/28507/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants