[New-bugs-announce] [issue14615] pull some import state out of the interpreter state

Eric Snow report at bugs.python.org
Wed Apr 18 18:32:42 CEST 2012

New submission from Eric Snow <ericsnowcurrently at gmail.com>:

Once the dust clears from the issue 2377 and issue 13959, we should consider what import-state-related members of PyInterpreterState (Include/pystate.h) can be removed.  This is in the interest of simplifying the interpreter state.

The most straightforward candidate is 'modules_reloading' (since reload() will likely become pure python), but we'll have to make sure we do not introduce any race conditions.

Another candidate that could probably go away, regardless of the import work, is 'modules_by_index'.  As far as I can see, there is only one use of    interp->modules_by_index in the cpython code-base: PyState_FindModule() in Python/pystate.c.  Likewise there is only one use of PyState_FindModule(): atexit_callfuncs() in Modules/atexitmodule.c.

Ultimately I'd love it if modules were also removed from the interpreter state, but doing that is not so cut-and-dry.

components: Interpreter Core
messages: 158638
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
status: open
title: pull some import state out of the interpreter state
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list