-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
SystemError when compiling deeply nested for loops #71701
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
The following code: |
There is a static limit for the number of statically nested blocks. Getting rid of this limit looks not easy. But SystemError is not an exception that should be raised. SystemError is for errors that can't be occurred in normal case. It should only be caused by incorrect use of C API or hacking Python internals. I think SyntaxError is more appropriate in this case (as in case of passing more than 255 arguments to a function). |
+1 for Serhiy's recommendation. It's OK for the compiler to say "Don't do that", but the correct error is SyntaxError, even when it's a limitation later in the code generation pipeline (rather than failing to comply with the language grammar) |
This patch changes it to a SyntaxError instead of a SystemError. |
Amended patch with the comment fixed to refer to just the issue numbers according to advice from bitdancer. |
LGTM. |
New changeset e6e7c8368c70 by Benjamin Peterson in branch '3.5': New changeset 345ec7455b75 by Benjamin Peterson in branch '2.7': New changeset d1da87d8b29c by Benjamin Peterson in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: