I have questions about this:
> In my branch where I'm fixing expand, I've moved the base _eval_expand
> functions to Expr. The result is that for expand to work on an
> object, it must be rebuildable via obj.func(*obj.args).
But how does then Symbol work? Are you just making a special case for
it? And how will expressions like TensorProduct(a, b+c) work?
For the second case it may be argued that it is the constructor of
TensorProduct that must do the expansion or that `expand` is and
should be only defined for Mul objects, so just for the moment I will
drop it.
However **if** (if not, it will be useful for me to know how you
solved the problem) you are special-casing Symbol, why stop just
there. It is not like Symbol is the only object that needs string for
a name and hence has to do something special with the
obj.func(*obj.args) stuff (as we permit only Basic in args for now).
Is the new expand doing something like this type of tree traversal?
def reconstruct():
if hasattr(obj, 'args') and obj.args:
return obj.func(map(reconstruct, obj.func))
else:
return 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.