Questions/issues regarding generators

Kevin Reid kpreid at
Thu Mar 7 09:00:47 PST 2013

On Thu, Mar 7, 2013 at 8:56 AM, Andreas Rossberg <rossberg at>wrote:

> On 7 March 2013 17:50, Kevin Reid <kpreid at> wrote:
> > Use of a singleton (or not marked for the specific generator) sentinel
> > object has a hazard: the sentinel is then a magic value which cannot be
> > safely processed by library code written to operate on arbitrary values,
> > which happens to use generators in its implementation.
> While that is true, it is conceptually no different from using a magic
> exception value, as under the current proposal. That clobbers use of
> that value for the exceptional return path in exactly the same way as
> the proposed alternative does for the regular return path. The only
> way to avoid both (in a single-function protocol) is the approach
> Claus mentioned.

There are conventional expectations about the exceptional return path —
interpretations independent of the specific code exiting via it — which
there are not about the normal return path.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list