[issue34762] Change contextvars C API to use PyObject

Yury Selivanov report at bugs.python.org
Fri Sep 21 12:37:21 EDT 2018


Yury Selivanov <yselivanov at gmail.com> added the comment:

> > one of the things we want to fix is to eliminate non-PyObject
> pointer types from public APIs entirely.

> A notable exception is Py_buffer. [1]

Right, because Py_buffer isn't a PyObject at all :)

> Using PyObject for contextvars makes sense (for the reasons you described) as long as they won't be shared between interpreters.

Yeah, PyContext, PyContextVar, and PyContextToken aren't supposed to be shared between sub-interpreters directly.  Context is essentially a mapping of Context Variables to arbitrary Python Objects, so sharing it transparently isn't possible.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34762>
_______________________________________


More information about the Python-bugs-list mailing list