[Python-ideas] New PEP 550: Execution Context

Yury Selivanov yselivanov.ml at gmail.com
Sat Aug 12 01:43:33 EDT 2017


> On Fri, Aug 11, 2017 at 10:17 PM, Guido van Rossum <guido at python.org> wrote:
> > I may have missed this (I've just skimmed the doc), but what's the rationale
> > for making the EC an *immutable* mapping? It's impressive that you managed
> > to create a faster immutable dict, but why does the use case need one?

> In this proposal, you have lots and lots of semantically distinct ECs.
> Potentially every stack frame has its own (at least in async code). So
> instead of copying the EC every time they create a new one, they want
> to copy it when it's written to. This is a win if writes are
> relatively rare compared to the creation of ECs.

Correct. If we decide to use HAMT, the ratio of writes/reads becomes
less important though.

Yury


More information about the Python-ideas mailing list