Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide NameError/AttributeError suggestions in traceback.py #97008

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
@ambv

Description

@ambv

Python 3.10 added NameError and AttributeError suggestions in raised exceptions, in the form of:

>>> dimTraceback (most recent call last):  File "<stdin>", line 1, in <module>NameError: name 'dim' is not defined. Did you mean: 'dir'?

This is implemented inPython/suggestions.c and unavailable in the pure Python implementation of traceback formatting inLib/traceback.py. This makes the output of both different, which is problematic for tooling usingtraceback.py, as well as for alternative implementations of Python like PyPy and GraalPy.

Let's implement the equivalent ofsuggestions.c inLib/traceback.py to bring both in line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp