diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-05-08 22:23:21 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-05-08 22:23:21 (GMT) |
commit | f7f858d1415514cb9a76a5b7da8ee6ccb774e6f4 (patch) | |
tree | c6bd7974442855ae64181f09fb6b2ccd2cc20b72 /Doc/c-api/reflection.rst | |
parent | 1aa4700234aa0657ee8cb12cfd9b615fef9e0300 (diff) | |
download | cpython-f7f858d1415514cb9a76a5b7da8ee6ccb774e6f4.zip cpython-f7f858d1415514cb9a76a5b7da8ee6ccb774e6f4.tar.gz cpython-f7f858d1415514cb9a76a5b7da8ee6ccb774e6f4.tar.bz2 |
Issue 5954, PyFrame_GetLineNumber:
Most uses of PyCode_Addr2Line
(http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get
the line number of a specified frame, but there's no way to do that directly.
Forcing people to go through the code object makes them know more about the
guts of the interpreter than they should need.
The remaining uses of PyCode_Addr2Line seem to be getting the line from a
traceback (for example,
http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line),
which is replaced by the tb_lineno field. So we may be able to deprecate
PyCode_Addr2Line entirely for external use.
Diffstat (limited to 'Doc/c-api/reflection.rst')
-rw-r--r-- | Doc/c-api/reflection.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 822c593..3996c1f 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -29,6 +29,11 @@ Reflection currently executing. +.. cfunction:: int PyFrame_GetLineNumber(PyFrameObject *frame) + + Return the line number that *frame* is currently executing. + + .. cfunction:: int PyEval_GetRestricted() If there is a current frame and it is executing in restricted mode, return true, |