Python Slice / Tuple Access #1133
-
I try to enable custom slicing for a class, hence I create a method as follow (simplified):
However, when running this, I get following error:
I followed the docs for slices here: And tuple should be accessible using brackets / operator[]: Any input why this happens? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
You must unpack the tuple with |
Beta Was this translation helpful? Give feedback.
-
This code might help you
|
Beta Was this translation helpful? Give feedback.
I'm not sure whether the above is supposed to work or if it's a bug.
However, either of the following works:
@wjakob,
how would you feel about a PR that adds support forstd::get
?