Distinguishing active generators from exhausted ones

greg greg at cosc.canterbury.ac.nz
Mon Jul 27 03:30:41 CEST 2009


Michal Kwiatkowski wrote:

> The first generator isn't finished, it yielded 1 and None. Second one
> is exhausted after yielding a single value (1). The problem is that,
> under Python 2.4 or 2.3 both invocations will generate the same trace
> output.

This seems to be a deficiency in the trace mechanism.
There really ought to be a 'yield' event to distinguish
yields from returns.

You could put in a feature request on python-dev
concerning this.

-- 
Greg



More information about the Python-list mailing list