Skip to content
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

PyCode "Unparse": Added support for slice objects in subscriptions #11981

Merged
merged 12 commits into from
Feb 14, 2024
Prev Previous commit
Next Next commit
Format code (add trailing comma)
  • Loading branch information
MatrixEditor committed Feb 14, 2024
commit 980afb8f642e778b5f84c2821ee9001495388030
2 changes: 1 addition & 1 deletion tests/test_pycode/test_pycode_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
("x[:, np.newaxis, :, :]",
"x[:, np.newaxis, :, :]"), # Index, Subscript, numpy extended syntax
("y[:, 1:3][np.array([0, 2, 4]), :]",
"y[:, 1:3][np.array([0, 2, 4]), :]") # Index, 2x Subscript, numpy extended syntax
"y[:, 1:3][np.array([0, 2, 4]), :]"), # Index, 2x Subscript, numpy extended syntax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just by looking at all those identity checks, I think we should have used a sentinel value, say IDENTICAL, to indicate that the output is the same as the input. This is an easy follow-up PR though.

])
def test_unparse(source, expected):
module = ast.parse(source)
Expand Down