rosidl_python icon indicating copy to clipboard operation
rosidl_python copied to clipboard

Tracking for Static Typing Related Bugs

Open InvincibleRMC opened this issue 5 months ago • 2 comments

From testing rclpy with the new changes two bugs/issue have appeared.

  1. typing.NoReturn is buggy. Service and Actions are treated as Callable[[], NoReturn] which just creates all sorts of badness. See https://github.com/python/mypy/issues/14044 for more details.

Simple enough fix just replace the more correct typing.NoReturn with None. #229

  1. Assuming only list for containers Containers are defined as a Union[list[T], Sequence[T], AbstractSet[T]]. However, in rclpy operations like append and remove are called on these fields when they might not exist.

Unlike 1. this is not a bug since mypy is now correctly exposing incorrect behavior, but I imagine that users might find it cumbersome to have to wrap the result in a more finite type to use any methods at all on them.

InvincibleRMC avatar Aug 07 '25 21:08 InvincibleRMC