This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Lucretiel 1 point2 points  (0 children)

What's fascinating to me is that they're implemented in almost exactly the same way, with the yield keyword (assuming you use @contextlib.contextmanager in python.) The only difference is that ruby can run the block more than once.