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

Function _flatten

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

flatten list

(lst)

Source from the content-addressed store, hash-verified

361 return dest
362
363def _flatten(lst):
364 """flatten list"""
365 if lst == []:
366 return lst
367 if atomp(lst):
368 return [lst]
369 return _flatten(lst[0]) + _flatten(lst[1:])
370
371def flatten(lst):
372 """flatten list or return scalar"""

Callers 1

flattenFunction · 0.70

Calls 1

atompFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…