Closed cool-RR closed 3 years ago
@paulc What do you think?
HI, thanks for the patch, this isn't actually faster (tested with timeit
- the maximum length of the list is 8 items) but it is a bit neater so will look to incorporate next time I do an update.
This is a faster and more idiomatic way of using
itertools.chain
. Instead of computing all the items in the iterable and storing them in memory, they are computed one-by-one and never stored as a huge list. This can save on both runtime and memory space.