-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Remove "value" from Symbol; add SymbolConstant... #714
Conversation
from PredefinedConstant. Doc strings have been over.
@@ -485,7 +485,7 @@ def format_operator(operator) -> Union[String, BaseElement]: | |||
return op | |||
return operator | |||
|
|||
precedence = prec.value | |||
precedence = prec.value if hasattr(prec, "value") else 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rocky, maybe it would be better to set the default to 670 (which is the default for precedence).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 means no parenthesis ever. 670 adds a parenthesis for everything except Get <<
.
So restating, are you sure we want parenthesis most of the time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, in that case, let's keep 0...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In another PR we may add a constant named "NEVER_ADD_PARENTHESIS". There was more refactoring oef the parenthesize function going on in #691
I will let this sit for a day, and if there are no comments or objections, I'll merge. |
Regarding this PR, I agree that Symbols should not have a "value" property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apart from the comment, LGTM
from PredefinedConstant.
Doc strings have been over.
This includes some of the stuff from #691. I think there is a little other stuff from that which should go in. But this narrows the differences.