std::vector from py::iterable
Open
@EricCousineau-TRI is already working on this.
Since Apr 13, 2021.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
At the moment list_caster in stl.h explicitly checks whether the input argument is a sequence, but I would like to argue that that's slightly too restrictive and iterable should be accepted.
The only potential downside I can think of is that generators should definitely not be accepted as a failed conversion of an element halfway through the generator would leave things in a terrible state, but a well-placed PyGen_Check could prevent that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.