feat: add __iter__ support to LayoutElements and Elements for native iteration by pira998 · Pull Request #437 · Unstructured-IO/unstructured-inference
Navigation Menu
{{ message }}
Unstructured-IO / unstructured-inference Public
- Notifications You must be signed in to change notification settings
- Fork 75
Open
pira998 wants to merge 1 commit intoUnstructured-IO:mainfrom
Open
feat: add __iter__ support to LayoutElements and Elements for native iteration#437
pira998 wants to merge 1 commit intoUnstructured-IO:mainfrom
feat: add __iter__ support to LayoutElements and Elements for native iteration#437
pira998 wants to merge 1 commit intoUnstructured-IO:mainfrom
Conversation
Copy link Copy Markdown
pira998
commented
Jul 6, 2025
pira998
commented
📝 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
LayoutElementscan be iterated over directly.
Test Coverage:
- Added:
test_layout_elements_iter_supportto validate the new behavior.
pira998
force-pushed
the
feat/layout-elements-iterable
branch
from
d973f69 to
be2e750
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment