Skip to content

Tracking for Static Typing Related Bugs #228

@InvincibleRMC

Description

@InvincibleRMC

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 NoReturn on __new__ and __init__ disables accessing @classmethods and ClassVars directly from the class python/mypy#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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions