Skip to content

Add name attribute to NameError #81978

Closed as duplicate
Closed as duplicate

Description

@sk
mannequin
BPO 37797
Nosy @sk-
PRs
  • bpo-33159: Add name attribute to NameError #6271
  • 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 = None
    created_at = <Date 2019-08-09.00:30:15.063>
    labels = ['interpreter-core', 'type-feature', '3.9']
    title = 'Add name attribute to NameError'
    updated_at = <Date 2019-08-24.14:34:03.068>
    user = 'https://github.com/sk'

    bugs.python.org fields:

    activity = <Date 2019-08-24.14:34:03.068>
    actor = 'corona10'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2019-08-09.00:30:15.063>
    creator = 'skreft'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37797
    keywords = ['patch']
    message_count = 1.0
    messages = ['349270']
    nosy_count = 1.0
    nosy_names = ['skreft']
    pr_nums = ['6271']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37797'
    versions = ['Python 3.9']

    Activity

    1. sk commented on Aug 9, 2019

      skmannequin
      MannequinAuthor

      PEP-473 was recently rejected (https://mail.python.org/pipermail/python-dev/2019-March/156692.html) because it was too broad and was suggested to be broken down in smaller issues.

      This issue is requesting the addition of the optional attribute name to NameError.

      The idea of having a structured attribute is to allow tools to act upon these exceptions. For example you could imagine a test runner which detect typos and suggests the right name to use.

      There is a current PR (#6271) adding this functionality, but it may need to be rebased as it has been awaiting a reply since April last year.

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-featureA feature request or enhancement
      on Aug 9, 2019
    3. transferred this issue fromon Apr 10, 2022
    4. cmaloney commented on Nov 9, 2025

      @cmaloney
      Contributor
    5. StanFromIreland commented on Nov 9, 2025

      @StanFromIreland
      Member

      I suggest you close as duplicate rather than completed.

    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

      3.9 (EOL)end of lifeinterpreter-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