On Tue, Aug 22, 2017 at 12:25 AM, Yury Selivanov <yselivanov...@gmail.com> wrote:
> On Mon, Aug 21, 2017 at 5:14 PM, Koos Zevenhoven <k7ho...@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 +
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com