rosidl_python icon indicating copy to clipboard operation
rosidl_python copied to clipboard

Add Python generator support for deprecated interface fields

Open Pengkun-ZHU opened this issue 8 months ago • 2 comments

Adds support for the @deprecated IDL annotation in the Python generator rosidl_generator_py.

When a message field is annotated with @deprecated, the generated Python class will:

  • Emit a DeprecationWarning (via PEP 702 typing_extensions.deprecated) when the field is accessed or set via the public property
  • Suppress the warning in internal operations (__eq__, __repr__, C extension type conversion) to avoid false positives

Depends on: ros2/rosidl#945

Signed-off-by: Pengkun-ZHU [email protected]

Pengkun-ZHU avatar Apr 03 '26 14:04 Pengkun-ZHU

We're quite close to feature freeze for ROS 2 Lyrical. Any chance we can re-target this to M-Turtle?

asymingt avatar Apr 16 '26 23:04 asymingt

Yeah this is fine for m turtle.

InvincibleRMC avatar Apr 17 '26 02:04 InvincibleRMC