Something like this could improve things. I got rid of the named tuples and made TextAccumulator a class with similar members: a pair of add() and out() members, and a pair of append() and output() aliases, in order to easily convert the existing code (and more importantly, to keep the diff friendly). I kept the API of text_accumulator().
Something like this could improve things. I got rid of the named tuples and made
TextAccumulator
a class with similar members: a pair ofadd()
andout()
members, and a pair ofappend()
andoutput()
aliases, in order to easily convert the existing code (and more importantly, to keep the diff friendly). I kept the API oftext_accumulator()
.