Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python slicing directly on container objects. #9

Open
lainproliant opened this issue Jul 26, 2020 · 0 comments
Open

Support Python slicing directly on container objects. #9

lainproliant opened this issue Jul 26, 2020 · 0 comments

Comments

@lainproliant
Copy link
Owner

lainproliant commented Jul 26, 2020

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:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant