Greg Ewing wrote: > Um, no -- it says explicitly right at the very top of > PEP 343 that it's only about factoring out try/finally > statements. > > There's no way that > > try: > code_block > finally: > ... > > can fail to enter the code block if you get as far as > the "try". So it's not reasonable to expect the with > statement to provide this ability.
We were working on the PEP for over a year though - expectations changed a bit when the ability to suppress exceptions was added (that wasn't in the original version of the PEP which was when most of the first few sections was written). I agree that try/finally was by far the main use case - it just isn't the only use case or we would never have included the option to suppress exceptions at all. Still, I'm happy to let this rest indefinitely - I doubt the daemonisation use case is going to be enough to change Guido's mind, and it really is rather difficult to come up with practical examples where the current behaviour is a genuine problem. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ 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