I have a list of instances of class Test. This class have method like name and parent
[Test('a', ''), Test('b', ''), Test('c', 'a'), Test('d', 'a'), Test('e', 'c')]
First argument is name, second parent. Parent arg is simply a arg name of parent class.
I want convert this list to string like:
Test('a', '')
|-- Test('c', 'a')
|-- Test('e', 'c')
|-- Test('d', 'a')
Test('b', '')
I looking for the most CPU-effective way to convert this list to string. Items in list can be nested at multiples (10,100, 1000, ..) levels, and I don't care about memory used.