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

Function flatten

Lib/test/test_buffer.py:359–363  ·  view source on GitHub ↗

flatten list or return scalar

(lst)

Source from the content-addressed store, hash-verified

357 return _flatten(lst[0]) + _flatten(lst[1:])
358
359def flatten(lst):
360 """flatten list or return scalar"""
361 if atomp(lst): # scalar
362 return lst
363 return _flatten(lst)
364
365def slice_shape(lst, slices):
366 """Get the shape of lst after slicing: slices is a list of slice

Callers 1

verifyMethod · 0.85

Calls 2

atompFunction · 0.85
_flattenFunction · 0.70

Tested by

no test coverage detected