[New-bugs-announce] [issue37797] Add name attribute to NameError

skreft report at bugs.python.org
Thu Aug 8 20:30:15 EDT 2019


New submission from skreft <skreft at gmail.com>:

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.

----------
components: Interpreter Core
messages: 349270
nosy: skreft
priority: normal
pull_requests: 14921
severity: normal
status: open
title: Add name attribute to NameError
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37797>
_______________________________________


More information about the New-bugs-announce mailing list