Skip to content

PyFrame_GetLineNumber #50204

Closed
Closed

Description

@jyasskin
mannequin
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']

    Activity

    1. jyasskin commented on May 7, 2009

      jyasskinmannequin
      MannequinAuthor

      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.

    2. pitrou commented on May 8, 2009

      @pitrou
      Member

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

    3. jyasskin commented on May 8, 2009

      jyasskinmannequin
      MannequinAuthor

      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.

    4. birkenfeld commented on Jan 6, 2010

      @birkenfeld
      Member

      This was merged in r74132.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions