by wfitz · 2y ago · 0 comments
# Really big generator that would probably crash as a list
divmods = (divmod(x,5) for x in range(100000000000000000000000000000000))
# Create a generator from a generator
remains = (remainder for n, remainder in divmods)
# Runs instantly
next(remains)
No comments yet.