classification
Title: PyFrame_GetLineNumber
Type: enhancement Stage: commit review
Components: Interpreter Core Versions: Python 3.1, Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: jyasskin Nosy List: collinwinter, georg.brandl, jyasskin, pitrou
Priority: normal Keywords: patch

Created on 2009-05-07 07:02 by jyasskin, last changed 2010-01-06 17:31 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
PyFrame_GetLineNumber.patch jyasskin, 2009-05-07 07:02
Messages (4)
msg87360 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2009-05-07 07:02
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.
msg87434 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-08 10:29
Please add doc to the patch, it looks ok otherwise.
msg87478 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2009-05-08 22:25
Documented and committed as r72488. This should be forward-ported to 3.x
also, but since we've already started the betas for 3.1, it should
probably wait for 3.2.
msg97314 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-01-06 17:31
This was merged in r74132.
History
Date User Action Args
2010-01-06 17:31:41georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
messages: + msg97314

2009-05-08 22:25:03jyasskinsetkeywords: - needs review

messages: + msg87478
2009-05-08 10:29:29pitrousetassignee: jyasskin
versions: + Python 3.1
nosy: + pitrou

messages: + msg87434
resolution: accepted
stage: patch review -> commit review
2009-05-07 07:02:42jyasskincreate