-
Notifications
You must be signed in to change notification settings - Fork 25
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
Stop auto-flattening #69
Comments
I think the auto-flattening is just fine. See >> import pymbolic.primitives as p
>>> a = p.Variable("a")
>>> b = p.Variable("b")
>>> c = p.Variable("c")
>>> (a * b) * c
Product((Variable('a'), Variable('b'), Variable('c'))) # flattening was legal and hence was done
>>> a * (b * c)
Product((Variable('a'), Product((Variable('b'), Variable('c'))))) # flattening wouldn't be legal and was avoided. |
12569d5 removed the flattening in |
As for flatten-upon-creation, we should document that the intended eval order is from left to right, so that the flattening behavior on operator overload is fine, as @kaushikcfd states. |
#152 removed the last of the auto-flattening AFAIK. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FP arithmetic isn't associative, after all.
The text was updated successfully, but these errors were encountered: