2 ms·
In Python, I'd normally use a generator: the language and libraries support you in coding that way. Occasionally you run into the only-iterate-through-once rest
by abecedarius 16y ago
In Python, I'd normally use a generator: the language and libraries support you in coding that way. Occasionally you run into the only-iterate-through-once restriction as a problem, and for that I stick a memoizing adaptor in.