3 ms·
> Nice, so this is the equivalent of `with` and context mangers in Python. Well, half of it at least :) Python has both enter and exit, while this proposal on
by zokier 3y ago
> Nice, so this is the equivalent of `with` and context mangers in Python.
Well, half of it at least :)
Python has both enter and exit, while this proposal only has the exit half.
- masklinn 3y agoTBF the `__enter__` hook is not the most useful.
- pwdisswordfishc 3y agoMore importantly, it does not allow distinguishing between successful completion and a thrown exception. Which may or may not be such a great feature in the first place, but still.