@ruudvanderham
Nothing here yet.
Nothing here yet.
No publications yet.
Hynek Černoch Maybe it would be better to use this quite different function as an inline flatten, very much like list.sort() or list.remove(). The return value is then always None and the list will be replaced by the flattened version. That can be implemented like: def flatten_inplace(lst): build = [] while lst: e = lst.pop() if isinstance(e, list): lst.extend(e) else: build.append(e) lst.extend(build[::-1])