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

[Python-Dev] PEP 550 v3

[Python-Dev] PEP 550 v3Yury Selivanov yselivanov.ml at gmail.com
Mon Aug 21 15:53:02 EDT 2017
On Sat, Aug 19, 2017 at 4:17 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
[..]
>>
>> * Generator's ``.send()`` and ``.throw()`` methods are modified as
>>   follows (in pseudo-C)::
>>
>>     if gen.__logical_context__ is not NULL:
>>         tstate = PyThreadState_Get()
>>
>>         tstate.execution_context.push(gen.__logical_context__)
>>
>>         try:
>>             # Perform the actual `Generator.send()` or
>>             # `Generator.throw()` call.
>>             return gen.send(...)
>>         finally:
>>             gen.__logical_context__ = tstate.execution_context.pop()
>>     else:
>>         # Perform the actual `Generator.send()` or
>>         # `Generator.throw()` call.
>>         return gen.send(...)
>
> I think this pseudo-code expansion includes a few holdovers from the
> original visibly-immutable API design.
>
> Given the changes since then, I think this would be clearer if the
> first branch used sys.run_with_logical_context(), since the logical
> context references at the Python layer now behave like shared mutable
> objects, and the apparent immutability of
> sys.run_with_execution_context() comes from injecting a fresh logical
> context every time.

This is a good idea, I like it!  It will indeed simplify the explanation.

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