A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-August/149068.html below:

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4Stefan Krah stefan at bytereef.org
Tue Aug 29 19:06:55 EDT 2017
On Tue, Aug 29, 2017 at 06:01:40PM -0400, Yury Selivanov wrote:
> PEP 550 positions itself as a replacement for TLS, and clearly defines
> its semantics for regular functions in a single thread, regular
> functions in multithreaded code, generators, and asynchronous code
> (async/await).  Everything is specified in the High-level
> Specification section.  I wouldn't call slightly differently defined
> semantics for generators/coroutines/functions an "inconsistency" --
> they just have a different EC semantics given how different they are
> from each other.

What I don't find so consistent is that the async universe is guarded
with async {def, for, with, ...}, but in this proposal regular context
managers and context setters implicitly adapt their behavior.

So, pedantically, having a language extension like

   async set(var, value)
   x = async get(var)

and making async-safe context managers explicit

   async with decimal.localcontext():
       ...


would feel more consistent.  I know generators are a problem, but even
allowing something like "async set" in generators would be a step up.



Stefan Krah



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4