[New-bugs-announce] [issue5954] PyFrame_GetLineNumber

Jeffrey Yasskin report at bugs.python.org
Thu May 7 09:02:44 CEST 2009


New submission from Jeffrey Yasskin <jyasskin at gmail.com>:

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
proposed PyFrame_GetLineNumber provides a more obvious and direct way to
do the same thing.

If this goes in, we might be able to deprecate PyCode_Addr2Line
entirely. The uses of PyCode_Addr2Line that don't get the line of a
particular frame 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.

----------
components: Interpreter Core
files: PyFrame_GetLineNumber.patch
keywords: needs review, patch
messages: 87360
nosy: collinwinter, jyasskin
severity: normal
stage: patch review
status: open
title: PyFrame_GetLineNumber
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file13909/PyFrame_GetLineNumber.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5954>
_______________________________________


More information about the New-bugs-announce mailing list