Conversation
some more lea{f,ves} -> element{,s} converted in places we are currently
trying to describe and don't want to have to explain that by X we really
mean Y.
| return '"' + self.value + '"' | ||
|
|
||
|
|
||
| # rocky: I really don't get why Filename has to be special, but so be it. |
There was a problem hiding this comment.
I also don't get it.
There was a problem hiding this comment.
This is just because we choose different print representations: Strings are rounded by quotes, and filenames don't.
There was a problem hiding this comment.
Ok. I guess that makes sense, but then why isn't Filename distinct from Symbol?
Is this how Mathematica does things too? I would have hoped they would say use another pair of delimiters like <Filename>.
I'll add a comment about this upon learning that __repr__ really is the "right" thing to do.
|
LGTM |
|
Side comment: some time ago, I noticed that in the AST module we have classes with names that appears also as |
Yeah, I wondered about this too. This may be yet more sloppiness, made harder to find due to a lack of positive description of intent. Or maybe it was the intent. Like Fermat's last theorem, keeping quiet is sometimes be assumed to be brilliance. Python's duck typing doesn't see this as an error. That the API interfaces are compatible is then probably not a coincidence. (Because if this was not the case, then Python would throw an exception.) At the Python level, one class is parser.Atom and the other class s expression.Atom. And I could see having these two be the same because they are equivalent being intentional or being viewed as the right thing. Renaming is a possibility and so is subclassing. But right now though I'd rather keep this as is and come back to this after we think about it some more. I'll add a comment to note the issue and think about and possibly take action. |
that we have two Atom classes. Make note of this, but defer a decision of what to do for later.
some more lea{f,ves} -> element{,s} converted in places we are currently
trying to describe and don't want to have to explain that by X we really
mean Y.