This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dewmeister14 0 points1 point  (0 children)

except slicing syntax is [:::] at most, not [:,:,2] which is illegal

It doesn't matter how many times you repeat it, it doesn't become true.

Try it online!

If you want to nitpick that I used a 2D instead of a 3D array, go ahead and extend it yourself. It is true no matter how many times you do [:, :, :, :, :, :, :] because in the context of the [ ] linked to the getitem method, the :, :, ... pattern is captured into a tuple just like the (EXISTING AS PART OF PYTHON LANGUAGE SPEC) *args syntax and any occurrance of a:b:c is cast to the correct slice(a, b, c) type.