MCPcopy Index your code
hub / github.com/python/cpython / multislice

Function multislice

Lib/test/test_buffer.py:384–388  ·  view source on GitHub ↗

Multi-dimensional slicing: slices is a list of slice objects.

(lst, slices)

Source from the content-addressed store, hash-verified

382 return [len(lst[slices[0]])] + slice_shape(lst[0], slices[1:])
383
384def multislice(lst, slices):
385 """Multi-dimensional slicing: slices is a list of slice objects."""
386 if atomp(lst):
387 return lst
388 return [multislice(sublst, slices[1:]) for sublst in lst[slices[0]]]
389
390def m_assign(llst, rlst, lslices, rslices):
391 """Multi-dimensional slice assignment: llst and rlst are the operands,

Calls 1

atompFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…