[Python-Dev] PEP 567 v2

Guido van Rossum guido at python.org
Wed Jan 3 00:46:57 EST 2018


Do you see any average Python users on this thread? We are trying to pick
the PEP apart from the POV of having to use the complicated parts of the
API in a framework. Victor's questions are reasonable.

On Tue, Jan 2, 2018 at 10:13 PM, Yury Selivanov <yselivanov.ml at gmail.com>
wrote:

> I don't want to expose a SetContext operation because of, again, potential
> incompatibility with PEP 550, where generators expect to fully control
> push/pop context operation.
>
> Second, Context.run is 100% enough for *any* async framework to add
> support for PEP 567. And because the PEP is focused just on async, I think
> that we don't need anything more than 'run'.
>
> Third, I have a suspicion that we focus too much on actual Context and
> Context.run. These APIs are meant for asyncio/twisted/trio/etc maintainers,
> not for an average Python user. An average person will likely not interact
> with any of the PEP 567 machinery directly, wven when using PEP 567-enabled
> libraries like numpy/decimal.
>
> Yury
>
> On Wed, Jan 3, 2018 at 2:56 AM Victor Stinner <victor.stinner at gmail.com>
> wrote:
>
>> PEP:
>> "int PyContext_Enter(PyContext *) and int PyContext_Exit(PyContext *)
>> allow to set and restore the context for the current OS thread."
>>
>> What is the difference between Enter and Exit? Why not having a single
>> Py_SetContext() function?
>>
>> Victor
>> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> https://mail.python.org/mailman/listinfo/python-dev
>> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
>> yselivanov.ml%40gmail.com
>>
>


-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180102/b361eff9/attachment.html>


More information about the Python-Dev mailing list