Stefan Behnel <stefan...@behnel.de> added the comment:

Adding to the list above:

"f_lasti" is used in "libpython.py", which is an almost exact copy of the one 
in CPython's "Tools/gdb/" for debugging Python code in gdb. If that 
implementation changes, we can probably adapt, especially since it uses runtime 
generated code. I don't find a C function for this necessary at this point, 
given that CPython will also need to access its own internals here in some way.

"f_localsplus" is used in the FASTCALL implementation and seems specific to 
Py3.6/7(?) which lacks the vectorcall protocol. So I guess it won't impact 3.8+ 
anymore. (The reason why its access is so complex is that StacklessPython has a 
slightly different frame struct, but we need to be binary(!) compatible with 
both.)

"f_back" is used in the coroutine implementation for correct exception 
traceback building, and the usage is pretty much copied from CPython. I doubt 
that there is much use for setting it outside of "code that tries to 
reimplement CPython behaviour", but Cython has to do exactly that here.

"f_lineno" is also used for traceback generation, because Cython creates frames 
when an exception occurs and needs to tell it what the current code line is. 
It's only used on newly created frames, although I can't guarantee that that 
will never change. Being able to read and set it seems reasonable.

"f_trace" is obviously used for tracing/profiling, and there isn't currently a 
good C-API for that, besides talking to frame struct fields (which is quite 
efficient when it comes to performance).

----------

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

Reply via email to