[Patches] [ python-Patches-584626 ] yield allowed in try/finally

noreply@sourceforge.net noreply@sourceforge.net
Mon, 29 Jul 2002 14:23:39 -0700


Patches item #584626, was opened at 2002-07-21 20:29
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=584626&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Oren Tirosh (orenti)
Assigned to: Nobody/Anonymous (nobody)
Summary: yield allowed in try/finally

Initial Comment:
A generator's dealloc function now resumes a generator
one last time by jumping directly to the return statement at 
the end of the code.  As a result, the finally section of any 
try/finally blocks is executed.  Any exceptions raised are 
treated just like exceptions in a __del__ finalizer.



----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2002-07-29 21:23

Message:
Logged In: YES 
user_id=35752

The GC will need to be taught about these finalizers.  Look
for the
method 'has_finalizer' in gcmodule.c.  I don't think we want
that
method to return true for all generator objects since that would
cause any reference cycle containing a generator to become
uncollectable.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=584626&group_id=5470