On Fri, Sep 28, 2018 at 3:29 PM, Gabriele <phoenix1...@gmail.com> wrote: > On Fri, 28 Sep 2018 at 23:12, Nathaniel Smith <n...@pobox.com> wrote: >> What information do you wish the interpreter provided, that would make your >> program simpler and more reliable? > > An exported global variable that points to the head of the > PyInterpreterState linked list (i.e. the return value of > PyInterpreterState_Head). This way my program could just look this up > from the dynsym section instead of scanning a dump of the bss section > in memory to find a possible candidate.
Hmm, it looks like in 3.7+, _PyRuntime is marked PyAPI_DATA, which I think should make it exported from dynsym? https://github.com/python/cpython/blob/4b430e5f6954ef4b248e95bfb4087635dcdefc6d/Include/internal/pystate.h#L206 And PyInterpreterState_Head is just _PyRuntime.interpreters.head. So maybe this is already done... -n -- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com