A method of a class is a generator. The object's text is changed after the generator is made, but before it is read.
class Poem:
def __init__(self, text):
self.text = text
def lines(self):
for n, line in enumerate(self.text.split("/"), 1):
yield str(n) + ":" + line.strip()
p = Poem("roses / violets /sugar")
g = p.lines()
p.text = "new"
print(list(g), len(list(p.lines())))
What does the program print?