[ python-Bugs-1464571 ] Changes to generator object's gi_frame attr

SourceForge.net noreply at sourceforge.net
Thu Apr 13 01:35:47 CEST 2006


Bugs item #1464571, was opened at 2006-04-05 01:44
Message generated for change (Comment added) made by zseil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1464571&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Collin Winter (collinwinter)
Assigned to: A.M. Kuchling (akuchling)
Summary: Changes to generator object's gi_frame attr

Initial Comment:
In 2.4 (as late as 2.4.3), a generator's gi_frame
attribute was always a frame object. In the current SVN
revision (43631), gi_frame is sometimes None, a change
I can't find any documentation of in the What's New for
2.5 section.

If this was intentional, it should be documented -- I
can't be the only one with packages that used this
behaviour. If it was unintentional, I'd appreciate it
if this could be fixed before 2.5 goes out.

I don't have a (simple) repro case at this time, but
I'll post one as soon as I can simplify the current one
down.

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

Comment By: Žiga Seilnacht (zseil)
Date: 2006-04-13 01:35

Message:
Logged In: YES 
user_id=1326842

This was changed again in revision 45316.
The current comment in genobject.h says:
Note: gi_frame can be NULL if the generator is "finished"

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

Comment By: Collin Winter (collinwinter)
Date: 2006-04-05 01:53

Message:
Logged In: YES 
user_id=1344176

*stops, thinks, comes up with repro case in 30 seconds*

This does indeed seem to be intentional (introduced in
r39239 during the implementation of PEP 342). To trigger
this, all you have to do is run a generator til exhaustion
(ie, StopIteration); at this point, the frame is decref'd
and gi_frame is set to None.

I'd appreciate it if this could be added to the "Porting to
2.5" section of What's New.

Sorry for the confusion.

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

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


More information about the Python-bugs-list mailing list