Mark Shannon <m...@hotpy.org> added the comment:

Nick Coghlan wrote:
> Nick Coghlan <ncogh...@gmail.com> added the comment:
> 
> The division of responsibilities between generator objects and the eval loop 
> is currently a little messy. The eval loop deals almost entirely with frame 
> objects and also handles swapping exception states around on behalf of 
> generators, which is why the generator specific exception state currently 
> lives on frame objects (i.e. to avoid the eval loop needing to know too much 
> about the internal structure of generator objects).

In my patch the exception state does not need swapping at all, so the 
question of whose responsibility it is become mute.
Neither generator nor ceval need to do it.

> 
> Before generator related state can reasonably be moved out of the frame 
> objects, those responsibilities should be divided more cleanly. Ron Adam has 
> made an initially attempt at tackling that problem in issue 13607.
> 
> Once the responsibilities are divided appropriately, *then* we can look at 
> the fields that ceval no longer touches and see if they should be moved 
> somewhere else (whether that's directly into the generator struct or into a 
> new struct referenced from the generator struct).

This patch is largely orthogonal to that proposed for issue 13607.
In fact the new CoState struct would be a better place to pass data 
between PyEval_EvalFrame() and gen_send(), rather than adding yet 
another field to the frame.

----------
title: Move fields relevant to coroutine/generators out of frame into 
generator/threadstate -> Move fields relevant to coroutine/generators out of    
  frame into generator/threadstate

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13897>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to