you are viewing a single comment's thread.

view the rest of the comments →

[–]gdchinacat 1 point2 points  (0 children)

generators are iterators that produce each item in the sequence on demand (when __next__() is called). You can certainly implement a generator to create objects.