[docs] Documentation bug for PyEval_SetTrace?

Sixten Hilborn sixt-hil at dsv.su.se
Wed Mar 28 15:49:29 CEST 2012


Hi!

I'm using the Python interpreter (2.6.6, but I've found the same 
problem in 2.7.3) to log function calls when running a couple of Python 
programs. However, I'm not sure about the 
PyEval_SetProfile/PyEval_SetTrace functions, since the output I get from 
the interpreter contains more differences than line number 
registrations.
According to the Python/C API documentation: "PyEval_SetTrace: Set the 
tracing function to func. This is similar to PyEval_SetProfile(), except 
the tracing function does receive line-number events."
After looking in the CPython source code (the macro C_TRACE, found in 
Python/ceval.c), it seems like PyEval_SetProfile also reports C function 
calls (and exceptions and return values, but I haven't tried them), 
while PyEval_SetTrace doesn't, is this a bug in the interpreter or in 
the documentation?

Regards,
Sixten Hilborn


More information about the docs mailing list