Skip to content

feat: Add iter method and Iterator class to _ds.pyi - #283

Merged
hzhangxyz merged 1 commit into
mainfrom
dev/update-ds-pyi
Mar 16, 2026
Merged

feat: Add iter method and Iterator class to _ds.pyi#283
hzhangxyz merged 1 commit into
mainfrom
dev/update-ds-pyi

Conversation

@hzhangxyz

Copy link
Copy Markdown
Member

Sync type stubs with ds.cc to include:

  • Search.iter() method returning Iterator
  • Chain.iter() method returning Iterator
  • New Iterator class with next() method

Sync type stubs with ds.cc to include:
- Search.iter() method returning Iterator
- Chain.iter() method returning Iterator
- New Iterator class with next() method

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 16, 2026 03:30
@hzhangxyz
hzhangxyz merged commit 09af9a3 into main Mar 16, 2026
88 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the _ds Python type stubs to reflect the underlying C++ bindings by adding an explicit iterator-based API for Search and Chain.

Changes:

  • Add Search.iter() returning a new _ds.Iterator.
  • Add Chain.iter() returning a new _ds.Iterator.
  • Introduce _ds.Iterator stub with a next() method returning Optional[Rule].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread apyds/_ds.pyi
Comment on lines +750 to +756
"""Iterator for Search and Chain results."""

def next(self) -> Optional[Rule]:
"""Get the next rule in the iteration.

Returns:
The next Rule object, or None if iteration is complete.
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.

2 participants