Am 23.03.2012 10:27, schrieb Aaron Meurer:
Yeah, I was thinking about that too.  I guess we should determine what
should be a separate class and what can just be a property of the
class.  I think immutability should definitely be a separate class,
because this is a fundamental property in Python.

"Fundamental" is in the eye of the beholder.
There's a better litmus test: Do they have the same list of operations? Require the operations the same preconditions, ensure the same postconditions?
If yes, it's the same class. If no, it's a different class.

Of course, since we're *defining* the operations, we have considerable leeway in making classes the same. However, for (im)mutability, making the class interfaces the same does not make any sense.

> I'm not sure about
evaluation.  Ronan's pointed out some of the issues that can come from
making it a property.

Also, as Matthew noted, I guess evaluation should really be a property
of the container object, not the object itself.  So we wouldn't really
need an UnevaluatedImmutibleMatrix, just an UnevaluatedMatrixMul.

I'm not sure what exactly distinguishes an evaluated from an unevaluated matrix, so I can't comment.

By the way, I think that an unevaluated Matrix would have to be
immutable, because that's how Mul (and hence MatrixMul) works.  So
there are really only three types of classes.

Sure, but the class proliferation will come soon enough.
Of course, sometimes the proliferation is worth the gains. Just make sure it's really worth something.

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