3 ms·
> The Python fans will counter that their less general solution is harder to abuse. Not sure why anybody would say that, you can plenty abuse `with` if you wan
by masklinn 14y ago
> The Python fans will counter that their less general solution is harder to abuse.
Not sure why anybody would say that, you can plenty abuse `with` if you want to have fun, the only thing you can't do is "dual-use" the block really (grab a context and invoke the block multiple times). And that you could always do with a decorator, if you're going there. The only thing `with` is is less flexible/general.
`unwind-protect` or `BlockClosure#ensure:` are probably much better examples of the philosophy opposite python though, I've always found ruby rather half-assed.