If the array classes are supposed to work just like Matrix where they
can be added together, and there are array expressions, then it
probably should as well. I'm not too familiar with the module, but it
doesn't look like array expressions exist yet, so that might be the
reason. ImmutableMatrix is Expr because it can be part of a MatAdd or
MatMul matrix expression, which subclass from Expr.
There has also been some discussion in the past whether classes that
behave like Expr should actually subclass from it or not. For
instance, there was some debate about this in the quantum module a
while back. I think the conclusion was that they should, because it's
too hard to make things work when not doing so.
Relational being an Expr is another can of worms. I agree it shouldn't
be, at least as it is currently used. IMO there should be separate
Expr and Boolean versions of relationals. See
https://github.com/sympy/sympy/issues/5031.
Ultimately, we still don't really have the best design for custom Expr
and Expr-like things. Especially when it comes to things like
dispatching inside of Add and Mul, there are some APIs that are there,
but we aren't necessarily happy with them. So I wouldn't assume that
just because something is done a certain way in SymPy that it is the
best way it can be done, particularly when it comes to the class
hierarchy and the ways of extending SymPy.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sympy+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/401e29e2-9a02-41ee-b549-f6d300c9d7cf%40googlegroups.com.