Skip to content

Support Python slicing directly on container objects. #9

@lainproliant

Description

@lainproliant

In the Python library, I'd like to override __getitem__ on container objects in a way that allows slicing. Right now, this is soft blocked on pybind/pybind11#1095. I could not try to use py::slice from Pybind11 and instead write my own custom type mapper at the libpython level, but I'd rather use py::slice and for now, this can be worked around in the Python interface by calling the container to get its contents and slicing those.

  • What we have to do today: document()[1:] or document.contents[1:]
  • What I'd like to do instead: document[1:]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions