On Mon, Aug 28, 2017 at 12:43 PM, Ethan Furman <et...@stoneleaf.us> wrote: > On 08/28/2017 09:12 AM, Yury Selivanov wrote: > >> If we forget about dynamic scoping (I don't know why it's being brought up >> all the >> time, TBH; nobody uses it, almost no language implements it) > > > Probably because it's not lexical scoping, and possibly because it's > possible for a function to be running with one EC on one call, and a > different EC on the next -- hence, the EC it's using is dynamically > determined. > > It seems to me the biggest difference between "true" dynamic scoping and > what PEP 550 implements is the granularity: i.e. not every single function > gets it's own LC, just a select few: generators, async stuff, etc. > > Am I right? (No CS degree here.) If not, what are the differences?
Sounds right to me. If PEP 550 was about adding true dynamic scoping, we couldn't use it as a suitable context management solution for libraries like decimal. For example, converting decimal/numpy to use new APIs would be a totally backwards-incompatible change. I still prefer using a "better TLS" analogy for PEP 550. We'll likely add a section summarizing differences between threading.local() and new APIs (as suggested by Eric Snow). Yury _______________________________________________ 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