Flatten list of lists in order in gh?

Is there a way to solve this as below, but for geometry not for numbers?

Something like the code below:

l = [[1, 2, 3], [4, 5, 6], [7], [8, 9]]
flat_list = []
for sublist in l:
    for item in sublist:
flat_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]

Not sure if it`s pseudocode or python?
Since you posted it in the grasshooper section , maybe you want to move it or change the title so it mentions python.

it’s just pseudocode

not sure if I am not completly misunderstanding you.
Most of the components have a flatten option when you right click over the input. Besides there exists a flatten component.

ah yes, you are right, my problem was in some other situation. i should delete this post… thanks

Coming back to this, Boundary Surface confused me here. It doesn’t preserve the list order pf the input curves.

Graft before input and Flatten after output

Well… in this case the list is already flattened. I’m sure your solution could work in some situations but sometimes tree structure is also important. Boundary surface sorts curves by Z :frowning: Much more useful in my opinion would be to preserve input structure…

here’s it is on a simple contour on some boxes example…