It is hard to reason about code when monkey patched and methods are overwritten.
This had two methods/property: joined() and lines() calling each other, and depending on how the object was constructed one was replaced by an attribute.
Is is convoluted and make static inference difficult.
Move to private attribute and always storing _lines (as a list of strings that are not terminated by newlines.
It is hard to reason about code when monkey patched and methods are overwritten.
This had two methods/property: joined() and lines() calling each other, and depending on how the object was constructed one was replaced by an attribute.
Is is convoluted and make static inference difficult.
Move to private attribute and always storing
_lines
(as a list of strings that are not terminated by newlines.