Skip to content

Add Python generator support for deprecated interface fields#256

Open
Pengkun-ZHU wants to merge 1 commit intoros2:rollingfrom
Pengkun-ZHU:feature/field-deprecation-annotation-rolling
Open

Add Python generator support for deprecated interface fields#256
Pengkun-ZHU wants to merge 1 commit intoros2:rollingfrom
Pengkun-ZHU:feature/field-deprecation-annotation-rolling

Conversation

@Pengkun-ZHU
Copy link
Copy Markdown

@Pengkun-ZHU Pengkun-ZHU commented Apr 3, 2026

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 q1091803103@gmail.com

Depends on: ros2/rosidl#945

Signed-off-by: Pengkun-ZHU <q1091803103@gmail.com>
@Pengkun-ZHU Pengkun-ZHU force-pushed the feature/field-deprecation-annotation-rolling branch from 72c4039 to 821cdb0 Compare April 3, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant