3 ms·
Some of the points are valid, but I'd like to see a follow-up post first once the author has learned about decorators (and maybe `with` statements).
by pshc 18y ago
Some of the points are valid, but I'd like to see a follow-up post first once the author has learned about decorators (and maybe `with` statements).
- d0mine 18y agoTrue. Here's his examples rewritten in Python (Python is not Ruby despite that both are nice languages): with atomicio_handler(afile) as handle: handle.write("foo") if blah: raise Exception, "baz" handle.write("bar") with atomicio_handler(afile) as fh1: with atomicio_handler(anotherfile) as fh2: ...