-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Improve syntax error for invalid imports #98931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
…rom y' instead of 'from y import x'
…ort x from y' instead of 'from y import x'
…es 'import x from y' instead of 'from y import x'
… instead of 'from y import x' (#98932)
Hi @pablogsal thanks for all your work on error messages. Is a similar situation, but where someone attempts to import more than one name from a module something we'd like to support? Currently this situation doesn't benefit from your updates: >>> import s, d from this
File "<stdin>", line 1
import s, d from this
^^^^
SyntaxError: invalid syntax Just came across it, so I thought I'd leave a note. Thanks again! |
Thanks a lot for the kind words and the suggestion! I will give some though to see how hard is to support this. :) |
… multiple targets
… multiple targets Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
…ple targets (#105985) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
… multiple targets (pythonGH-105985) (cherry picked from commit 13237a2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
… multiple targets (python#105985) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Is quite common to type
import x from y
instead offrom y import x
. We can easily offer a better error message in this case.The text was updated successfully, but these errors were encountered: