Skip to content

std::vector from py::iterable #1773

Open
@davidhewitt

Description

@davidhewitt

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions