Skip to content

feat: add __iter__ support to LayoutElements and Elements for native iteration #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pira998
Copy link

@pira998 pira998 commented Jul 6, 2025

📝 PR Description:

This PR addresses #436 by adding __iter__() support to both LayoutElements and Elements classes.

Changes:

  • Implemented __iter__() method in:

    • LayoutElements (delegates to .iter_elements())
    • Elements (delegates to .iter_elements())
  • Enables native Python-style iteration:

    for el in layout_elements:
        ...
  • Added a minimal unit test to confirm LayoutElements can be iterated over directly.

Test Coverage:

  • Added: test_layout_elements_iter_support to validate the new behavior.

@pira998 pira998 force-pushed the feat/layout-elements-iterable branch from d973f69 to be2e750 Compare July 6, 2025 19:24
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