zlacker
[parent]
[thread]
1 comments
1. psycho+(OP)
[view]
[source]
2024-06-06 09:54:11
How is that hiding the loop? I would expect takewhile to be a loop although I never used this Python facility.
replies(1):
>>schoen+j42
◧
2. schoen+j42
[view]
[source]
2024-06-06 23:11:49
>>psycho+(OP)
All of the itertools functions are implemented using loops, but they heavily abstract over them so that users can think in terms of "streams" (or officially "iterators") without writing loop-oriented code themselves.
[go to top]