Different parts of sympy have different assumptions about how strict
the content of args should be. Focusing on the most important and what
has not been questioned:

If you have an instance called obj, this should hold:
obj.func(*obj.args) == obj

If you do funny stuff to your args, do not forget to check that
_hashable_content was not brocken.

It would be good to ensure that all the internal magic is not broken
by your classes:

for class Whatever and arguments test_args:

hash(Whatever(*test_args)) = hash(Whatever(*test_args)).
Whatever(*test_args) != Whatever(*different_args)

Check that .subs, .atoms and .free_symbols work on expressions
containing your classes (by expressions I do not necessary mean Expr
subclasses). This reveals **a lot** of mistakes.

Also keep in mind, that if you ever want to rebuild the expression
tree with obj.func(*obj.args) it may be very bad if it takes a lot of
time.

Finally, correspondence between arguments of the constructor and the
args attribute can be completely ignored (and there are some classes
that do it), however it is a bit more difficult to reason about it,
and it is not automatically supported by the sympy internal dark magic
(by supported I again mean obj.func(*obj.args)==obj).

-- 
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