New submission from Leonard Lausen <leon...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue39660>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to