Op vrijdag 11 januari 2013 11:16:07 UTC+1 schreef David Loeffler het 
volgende:
>
>
> So I think it's acceptable if Matrix_integer_2x2 doesn't implement 
> everything in the Sage matrix specification, 
>
I almost agree. I think that it would be acceptable to raise a 
NotImplementedError for some methods,  but random failures like the one we 
saw above should still be avoided.
 

> and in particular if we set it up so its elements are *always* immutable; 
> and we change the .matrix() element of SL2Z elements to return a 
> Matrix_integer_dense copy of the internal Matrix_integer_2x2. What do 
> others think about this suggestion?
>
I'm not opposed to this. But if we change the behavior by that much, does 
it need to inherit from Matrix_dense at all? From my point of view, it 
would be better to not violate reasonable expectations people will have 
about the interface of subclasses, even if the one having the expectations 
is a 'developer', not an 'end-user'.

I think the reason for subclassing in this case is code-reuse. But that's 
in itself a dangerous thing to do if we change the class' internal behavior 
by this much. People changing the code for Matrix_dense shouldn't need to 
deal with issues in a non-conforming subclass -- but they will have to when 
their changes suddenly cause doctests to fail.

Timo

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to