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

Function genslices

Lib/test/test_buffer.py:714–716  ·  view source on GitHub ↗

Generate all possible slices for a single dimension.

(n)

Source from the content-addressed store, hash-verified

712# ======================================================================
713
714def genslices(n):
715 """Generate all possible slices for a single dimension."""
716 return product(range(-n, n+1), range(-n, n+1), range(-n, n+1))
717
718def genslices_ndim(ndim, shape):
719 """Generate all possible slice tuples for 'shape'."""

Callers 3

genslices_ndimFunction · 0.85
test_memoryview_arrayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…