[replying to the list] > 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 possible to implement Execution Context with a mutable mapping and copy-on-write (as it's done in .NET) This is one of the approaches that I tried and I discovered that it causes a bunch of subtle inconsistencies in contexts for generators and coroutines. I've tried to cover this here: https://www.python.org/dev/peps/pep-0550/#copy-on-write-execution-context All in all, I believe that the immutable mapping approach gives the most predictable and easy to reason about model. If its performance on large number of items in EC is a concern, I'll be happy to implement it using HAMT (also covered in the PEP). Yury _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/