MCPcopy Index your code
hub / github.com/RustPython/RustPython / cmp_structure

Function cmp_structure

Lib/test/test_buffer.py:400–411  ·  view source on GitHub ↗

Compare the structure of llst[lslices] and rlst[rslices].

(llst, rlst, lslices, rslices)

Source from the content-addressed store, hash-verified

398 return llst
399
400def cmp_structure(llst, rlst, lslices, rslices):
401 """Compare the structure of llst[lslices] and rlst[rslices]."""
402 lshape = slice_shape(llst, lslices)
403 rshape = slice_shape(rlst, rslices)
404 if (len(lshape) != len(rshape)):
405 return -1
406 for i in range(len(lshape)):
407 if lshape[i] != rshape[i]:
408 return -1
409 if lshape[i] == 0:
410 return 0
411 return 0
412
413def multislice_assign(llst, rlst, lslices, rslices):
414 """Return llst after assigning: llst[lslices] = rlst[rslices]"""

Callers 1

multislice_assignFunction · 0.85

Calls 2

slice_shapeFunction · 0.85
lenFunction · 0.85

Tested by

no test coverage detected