[Python-Dev] PEP 550 v3

Koos Zevenhoven k7hoven at gmail.com
Mon Aug 21 17:39:00 EDT 2017


On Tue, Aug 22, 2017 at 12:25 AM, Yury Selivanov <yselivanov.ml at gmail.com>
wrote:

> On Mon, Aug 21, 2017 at 5:14 PM, Koos Zevenhoven <k7hoven at gmail.com>
> wrote:
> [..]
> >> This has consequences for the design in the PEP:
> >>
> >> * what we want to capture at generator creation time is the context
> >> where writes will happen, and we also want that to be the innermost
> >> context used for lookups
> >
> >
> > I don't get it. How is this a consequence of the above two points? And
> why
> > do we need to capture something (a "context") at generator creation time?
> >
>
> We don't need to "capture" anything when a generator is created (it
> was something that PEP 550 version 1 was doing).
>
>
​Ok, good.​



> In the current version of the PEP, generators are initialized with an
> empty LogicalContext.  When they are being iterated (started or
> resumed), their LogicalContext is pushed to the EC.  When the
> iteration is stopped (or paused), they pop their LC from the EC.
>
>
Another quick one before I go: Do we really need to push and pop a LC on
each next() call​, even if it most likely will never be touched?

-- Koos

-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170822/83f8f3f8/attachment.html>


More information about the Python-Dev mailing list