"Moore, Paul" <Paul.Moore@atosorigin.com> writes: > Alex Martelli suggested transactional processing may be a reasonable use case > for needing exception handling (commit in __exit__ and rollback in __except__) I'm not sure an additional __except__ is really needed even for the transactional use case. It's probably enough to check whether sys.exc_info()[0] is None to figure out whether __exit__ was called because of an exception or a regular way of leaving the block. > but I don't think the gain is worth the extra complexity - I'd say leave this > coded as now with try...except..else. (Alex - care to convince me otherwise?) For me the transactional use quite important too. It's the use case that made me wish for this kind of thing several years ago when I had started to implement undo in Sketch. Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://www.mapit.de/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4