[New-bugs-announce] [issue39660] Contextvars: Optional callbacks on state change

Leonard Lausen report at bugs.python.org
Mon Feb 17 00:44:47 EST 2020

New submission from Leonard Lausen <leonard at lausen.nl>:

contextvars provide APIs to manage, store, and access context-local state.

Unfortunately, if Python is used as a frontend for a native libray (eg accessed via ctypes), and in case that the state of interest is managed in the native library, contextvar API is insufficient.

To support native libraries, instead of simply exposing the current state via `contextvar.get()`, contextvar API could allow specification of callbacks to update the state in the native library.

messages: 362118
nosy: leezu
priority: normal
severity: normal
status: open
title: Contextvars: Optional callbacks on state change
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list