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

Function cmp_structure

Lib/test/test_buffer.py:412–423  ·  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

410 return llst
411
412def cmp_structure(llst, rlst, lslices, rslices):
413 """Compare the structure of llst[lslices] and rlst[rslices]."""
414 lshape = slice_shape(llst, lslices)
415 rshape = slice_shape(rlst, rslices)
416 if (len(lshape) != len(rshape)):
417 return -1
418 for i in range(len(lshape)):
419 if lshape[i] != rshape[i]:
420 return -1
421 if lshape[i] == 0:
422 return 0
423 return 0
424
425def multislice_assign(llst, rlst, lslices, rslices):
426 """Return llst after assigning: llst[lslices] = rlst[rslices]"""

Callers 1

multislice_assignFunction · 0.85

Calls 1

slice_shapeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…