PyO3 / PyO3/pyo3

Implement `IntoPyObject for Result<T, E> where E: Into<PyErr>`

Open
#4,782 11 comments 0 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

It would be nice to have this implemented so one could use PyList::new, PyTuple::new & PySet::new with fallible iterators. One quick look into the source code showed me that the callback conversion code needs adjusting to make this possible (if possible at all).

Does someone have an idea if this is feasible or wanted at all before I jump in this rabbit hole to implement this?

Thanks in advance.

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

Read src/impl_/callback.rs and trace the conversion paths used by PyList::new, PyTuple::new, and PySet::new. Done means determining whether fallible iterators can use Result<T, E> with E: Into and implementing the requested conversion if feasible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.