4 ms·
Really? That's one of the things I like about Python: how its for loops consistently consume an iterator, and that's it. Anything that looks like an iterator ca
by kstrauser 2y ago
Really? That's one of the things I like about Python: how its for loops consistently consume an iterator, and that's it. Anything that looks like an iterator can be looped across or used in a comprehension without special casing.
- ahartmetz 2y agoI remember some Ruby tutorial that proudly showcased a 5.times begin loop_body end loop. Too cutesy IMO.