3 ms·
Python's lazy, composable iterators/generators are my #1 favorite Python language feature and I find myself missing it in every other language I use.
by nerdponx 6y ago
Python's lazy, composable iterators/generators are my #1 favorite Python language feature and I find myself missing it in every other language I use.
- RangerScience 6y agoMost (all?) of Rail's iterators are available as lazy iterators, and I think ditto for core Ruby (it's literally `foo.lazy.each`). Not sure what you mean by "composable" that isn't also the case in Ruby; community standard definitely seems to be that an iterator dot chain doesn't change type (or when it does it's real obvious) making it easy to `.map`, `.select`, etc.