PyO3 / PyO3/pyo3

Support `collections.abc.Iterable` type

Open
#5,757 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

There is already a mapping to collections.abc.Iterator, but it would be nice to get one for Iterable that has a simple way to create a PyIterator from it.

This should allow us to take advantage of Rust's type system when imitating a function like sum.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing collections.abc.Iterator mapping in the linked PyO3 conversions tables and trace how it creates a PyIterator. Add the corresponding Iterable support and a simple way to create a PyIterator, then add or update tests showing the mapping works for an Iterable and supports sum-like usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.