[New-bugs-announce] [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

STINNER Victor report at bugs.python.org
Wed Apr 24 08:58:00 EDT 2019


New submission from STINNER Victor <vstinner at redhat.com>:

Eric Snow moved global variables into a _PyRuntimeState structure which is made of sub-structures. There is a single instance of _PyRuntimeState: the _PyRuntime global variable.

I would like to add "_PyRuntimeState *" parameters to functions to avoid relying directly on _PyRuntime global variable. The long term goal is to have "stateless" code: don't rely on global variables, only on input parameters. In practice, we will continue to use thread local storage (TLS) to get the "current context" like the current interpreter and the current Python thread state.

----------
components: Interpreter Core
messages: 340772
nosy: vstinner
priority: normal
severity: normal
status: open
title: Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable
versions: Python 3.8

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


More information about the New-bugs-announce mailing list