Hi,

I have been slightly worried about having strings in the .args. I have been wondering for a while now if it might be better to replace the "name" attribute with a more generic "payload" attribute, which is used to identify objects. You could still keep the "name" parameter, and in the __new__ method construct a Symbol of that name as payload. Note that this way you could put in Dummy as payload as well, and get anonymous objects for free (as far as I can tell)!

This is just a suggestion, I don't feel strongly about it; but I think it might be the easiest solution.

On 10.06.2012 21:27, Sergiu Ivanov wrote:
On Sun, Jun 10, 2012 at 11:24 PM, Aaron Meurer<[email protected]>  wrote:

Either use Symbol (directly or by subclassing) or look at how Symbol
does it. I think the key for Symbol is that it subclasses from Atom,
so it has an empty .args. Also, it overrides _hashable_content so that
it hashes correctly.

Symbol has an empty .args.

However, I seem to have just got an asnwer from one of Tom's new
comments on my pull request [0]: store a Tuple(name).  Is this going
to be OK?


My comment regarding Tuple was that it should be replacing the list of components you are storing, not the name.

I'm just afraid that using Symbol will bring too much stuff into my
simple class.

Sergiu


--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to