4 ms·
FWIW the Python implementation of Stuff seems not all that Pythonic. Returning self from __iter__ and keeping state where the iteration is works, but breaks if
by dosinga 2y ago
FWIW the Python implementation of Stuff seems not all that Pythonic. Returning self from __iter__ and keeping state where the iteration is works, but breaks if you over the same object from an iter. To me that really distracts from the argument since the idiomatic implementation in Python and Ruby look almost exactly the same
- alexcosan 2y agoOn the same note, the implementation of Stuff in Ruby is not very ruby-like. It could have just used `.each` on the `@a_list` (in that case, you just delegate the implementation to `@a_list`, no reason to use a for-loop.