-
Notifications
You must be signed in to change notification settings - Fork 133
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
[Python frontend]: Python 3.11.7 + enumerate + subscript breakage #1568
Comments
First evaluation: I checked the code snippet above with both Python versions, and the issue at a superficial level is the following. In Python 3.8, the Information for further debugging (@tbennun maybe you have an insight on this?): try:
gslice = astutils.evalnode(node.slice, self.globals)
except SyntaxError:
return self.generic_visit(node) |
I haven't dug in this code so much, but it seem to me something changed to Indeed in 3.8 it all failed so the return is just the same node. I pushed a PR that, restrict the list to the slice then try to turn elements into constant, then return the corrected list. Works for my use case. |
Looking at: #1568 The code was blindly calling down to a `_visit_potential_constant` which is written for single element rather collection of them. Unroll the list, like the `dict` is done in the `if` above.
Follow up of #1460 - [x] Fixed the `ci` script (including `git checkout issues` around selecting the correct `dace`) - [x] Move `D_SW` to execute only on rank 0 to avoid rebuild - [x] Swapped Rieman Solver on C-grid for D-grid for better coverage ~~WARNING: this PR is blocked by #1477~~ ~~WARNING: this PR is blocked by #1568~~ --------- Co-authored-by: Tal Ben-Nun <tbennun@users.noreply.github.com>
Describe the bug
The interaction of python
3.11.7
andenumerate
+subscript
is breaking the parsing. The following code is a reduction of a code in NASA/NOAA dynamical core. This works with python3.8.X
To Reproduce
With python-3.11.7:
Traceback:
The text was updated successfully, but these errors were encountered: