On 1/1/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I believe the main argument *against* having the tb included in the > exception is that it would greatly increase the cyclic nature of > tracebacks and stack frames, which in turn would cause lots of code to > break due to late GC'ing of unclosed files, etc. For example, this > code: > > try: > 1/0 > except Exception, err: > pass > > will introduce a cycle from err -> traceback -> stack frame -> err, > keeping all locals in the same scope alive until the next GC happens.
This should probably be made explicit in PEP 344. I also keep thinking that there ought to be a solution involving weak references, though I don't trust quite trust myself on what that should be. (The only obviously correct solution is to make the new err->traceback link a weakref and not clean the sys.* interface.) -jJ _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
