-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Currently we have:
>>> import typing as t; None = 1
File "<python-input-0>", line 1
import typing as t; None = 1
^
SyntaxError: cannot use name as import target
which doesn't make sense. Prior to #123629, it was:
>>> import typing as t; None = 1
File "<python-input-0>", line 1
import typing as t; None = 1
^^^^
SyntaxError: cannot assign to None
We should restore the old message for this case.
I have a patch ready.
CPython versions tested on:
CPython main branch, 3.14
Operating systems tested on:
Linux
Linked PRs
efimov-mikhail
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error