New submission from Fabio Zadrozny <fab...@users.sourceforge.net>:

In CPython 3.7 it was possible to do:

#include "pystate.h"
...
PyThreadState *ts = PyThreadState_Get();
PyInterpreterState *interp = ts->interp;
interp->eval_frame = my_frame_eval_func;

This is no longer possible because in 3.8 the PyInterpreterState is opaque, so, 
Py_BUILD_CORE_MODULE needs to be defined defined and 
"internal/pycore_pystate.h" must be included to set 
PyInterpreterState.eval_frame.

This works but isn't ideal -- maybe there could be a function to set 
PyInterpreterState.eval_frame?

----------
components: Interpreter Core
messages: 354803
nosy: fabioz, vstinner
priority: normal
severity: normal
status: open
title: Provide a way to get/set PyInterpreterState.frame_eval without needing 
to access interpreter internals
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38500>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to