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

Evaluate flag #19890

Open
proy87 opened this issue Aug 5, 2020 · 7 comments
Open

Evaluate flag #19890

proy87 opened this issue Aug 5, 2020 · 7 comments
Labels

Comments

@proy87
Copy link

proy87 commented Aug 5, 2020

It would be good if evaluate was stored as class attribute, so I could check whether I have unevaluated expression.

@proy87
Copy link
Author

proy87 commented Aug 5, 2020

Also, Add(0,1,2,3,evaluate=False).args gives 1,2,3, because args = [a for a in args if a is not cls.identity] removes it.

@oscarbenjamin
Copy link
Contributor

Really I'd like to get rid of evaluate=False. I think that not evaluating should be the default.

The other issue is fixed in master from #19450:

In [79]: Add(0,1,2,3,evaluate=False).args                                                                                                      
Out[79]: (0, 1, 2, 3)

@proy87
Copy link
Author

proy87 commented Aug 5, 2020

@oscarbenjamin , but we need to track whether expression is evaluated. For example, I want to keep order of args unchanged when printing, if an expression is unevaluated.

@oscarbenjamin
Copy link
Contributor

I don't see why we don't just print the args in order all the time

@proy87
Copy link
Author

proy87 commented Aug 6, 2020

Because for me it is more natural n-1 then -1+n

@oscarbenjamin
Copy link
Contributor

That particular example is better but there are others e.g.:

In [40]: -y + z                                                                                                                                
Out[40]: -y + z

In [41]: _.args                                                                                                                                
Out[41]: (z, -y)

@proy87
Copy link
Author

proy87 commented Aug 6, 2020

Possibly, the sorting of args should be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants