Skip to content

Suggest a future feature name in from __future__ import #145868

Description

@Locked-chess-official

Feature or enhancement

Proposal:

When from __future__ import with a wrong name, maybe it is a typo. We can suggest a possible name. Just like:

>>> from __future__ import annotation
  File "<python-input-0>", line 1
    from __future__ import annotation
                           ^^^^^^^^^^
SyntaxError: future feature 'annotation' is not defined. Did you mean: 'annotations'?

One possible way is just read the line and analyse.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions