Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyFrame_GetLineNumber #50204

Closed
jyasskin mannequin opened this issue May 7, 2009 · 4 comments
Closed

PyFrame_GetLineNumber #50204

jyasskin mannequin opened this issue May 7, 2009 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@jyasskin
Copy link
Mannequin

jyasskin mannequin commented May 7, 2009

BPO 5954
Nosy @birkenfeld, @pitrou
Files
  • PyFrame_GetLineNumber.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-01-06.17:31:41.485>
    created_at = <Date 2009-05-07.07:02:42.463>
    labels = ['interpreter-core', 'type-feature']
    title = 'PyFrame_GetLineNumber'
    updated_at = <Date 2010-01-06.17:31:41.483>
    user = 'https://bugs.python.org/jyasskin'

    bugs.python.org fields:

    activity = <Date 2010-01-06.17:31:41.483>
    actor = 'georg.brandl'
    assignee = 'jyasskin'
    closed = True
    closed_date = <Date 2010-01-06.17:31:41.485>
    closer = 'georg.brandl'
    components = ['Interpreter Core']
    creation = <Date 2009-05-07.07:02:42.463>
    creator = 'jyasskin'
    dependencies = []
    files = ['13909']
    hgrepos = []
    issue_num = 5954
    keywords = ['patch']
    message_count = 4.0
    messages = ['87360', '87434', '87478', '97314']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'collinwinter', 'pitrou', 'jyasskin']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue5954'
    versions = ['Python 3.1', 'Python 2.7']

    @jyasskin
    Copy link
    Mannequin Author

    jyasskin mannequin commented May 7, 2009

    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.

    @jyasskin jyasskin mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels May 7, 2009
    @pitrou
    Copy link
    Member

    pitrou commented May 8, 2009

    Please add doc to the patch, it looks ok otherwise.

    @jyasskin
    Copy link
    Mannequin Author

    jyasskin mannequin commented May 8, 2009

    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.

    @birkenfeld
    Copy link
    Member

    This was merged in r74132.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants