Closed jmishra01 closed 1 year ago
I like this change!
Review: You can turn a few more of the "yield"s to "yield from"s.
@erezsh Done!
What I meant is that you don't need any for loop..
yield from (i for i in ('\t', '%s' % (self.children[0],), '\n'))
can be
yield from ('\t', '%s' % (self.children[0],), '\n')
etc.
Although this particular expression can be rewritten as a single string format.
Give it another try if you like. Otherwise no problem, I'll do the finishing touches myself.
Thank you for review, I change few lines, use yield with f-string method.
Thanks!
We can use generator to create pretty string of Tree in place of list. This PR reduce memory usage.