Skip to content

Support iterable inputs in LifecycleTransition - #556

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/support-lifecycle-transition-iterables
Open

Support iterable inputs in LifecycleTransition#556
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/support-lifecycle-transition-iterables

Conversation

@Old-Ding

Copy link
Copy Markdown

Summary

  • materialize LifecycleTransition iterable inputs once before validation
  • support generators and iterators as promised by the public Iterable annotations
  • keep the existing empty-input ValueError behavior for iterator inputs

Testing

  • focused source behavior probe: baseline raises TypeError for iterators, while the fixed constructor accepts them
  • verified empty iterators still raise the existing field-specific ValueError
  • python -m py_compile for both modified Python files
  • flake8 on both modified files with the repository's existing E501/W504 exclusions
  • git diff --check

LifecycleTransition accepts Iterable inputs but called len() before consuming them, which rejected generators and iterators. Materialize each input once so all finite iterables follow the existing validation and normalization path.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@mergify

mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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