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/148901.html below:

[Python-Dev] PEP 550 v3 naming

[Python-Dev] PEP 550 v3 namingYury Selivanov yselivanov.ml at gmail.com
Wed Aug 23 12:19:40 EDT 2017
I think that "implicit context" is not an accurate description of what
LogicalContext is.

"implicit context" only makes sense when we talk about decimal
context.  For instance, in:

    Decimal(1) + Decimal(2)

decimal context is implicit.  But this is "implicit" from the
standpoint of that code.  Decimal will manage its context
*explicitly*.

Fixing decimal context is only one part of the PEP though.  EC will
also allow to implement asynchronous task locals:

    current_request = new_context_key()

    async def handle_http_request(request):
         current_request.set(request)

Here we explicitly set and will explicitly get values from the EC.  We
will explicitly manage the EC in asyncio.Task and when we schedule
callbacks.

Values stored in the EC are essentially globals (or TLS), which we
don't call "implicit" in Python.

PEP 550 calls generators and asynchronous tasks as "logical threads",
and "logical context" stems directly from that notion.

"implicit" only covers one part of what LC really is. It implies that
all EC/LC operations are implicit, which they are not.

Logical Context is a neutral abstract term.  Implicit Context bears a
specific meaning that I don't think is accurate.

Yury
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