Distinguishing active generators from exhausted ones

greg greg at cosc.canterbury.ac.nz
Sun Jul 26 21:30:41 EDT 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.


More information about the Python-list mailing list