This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add name attribute to NameError
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: skreft
Priority: normal Keywords: patch

Created on 2019-08-09 00:30 by skreft, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 6271 skreft, 2019-08-09 00:30
Messages (1)
msg349270 - (view) Author: (skreft) Date: 2019-08-09 00:30
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 (https://github.com/python/cpython/pull/6271) adding this functionality, but it may need to be rebased as it has been awaiting a reply since April last year.
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81978
2019-08-24 14:34:03corona10setpull_requests: - pull_request15147
2019-08-24 08:37:47corona10setpull_requests: + pull_request15147
2019-08-24 08:36:55corona10setpull_requests: - pull_request15145
2019-08-24 08:36:28corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request15145
2019-08-09 00:30:15skreftcreate