[Nick Coghlan] > However, I'm fine with declaring that, from the perspective of a statement > template, 'return', 'break' and 'continue' are all 'non-exceptional exits', > and > so templates like transaction() are expected to treat them as such.
Me too. The argument that made me realize this is okay came after reading Raymond Chen's rant about control-flow macros: when you catch an exception, you don't know how much of the try-block was executed successfully, and neither does the author of that block; but when you "catch" a non-local goto, you must assume that the block's author knows what they are doing, so at least *they* know exactly which code was executed (everything up to the break/continue/return) and which wasn't. So the argument about rolling back indeterminate results doesn't hold. If they want the transaction to fail, they should raise an exception. I really need to start writing PEP 343 to capture this particular solution more carefully. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com