On Jan 11, 5:27 am, David Loeffler <d.a.loeff...@warwick.ac.uk> wrote:
> I'm keen to keep Matrix_integer_2x2 as a subclass of Matrix. I'd have said
> that doing it any other way is likely to cause lots of obscure bugs (since
> developers will quite naturally assume that Matrix_xxx is a subclass of
> Matrix for any value of xxx, and have probably already done so in existing
> code).

Isn't the real bug here that Matrix uses a much too heavy device to
keep track of a boolean flag (mutability=true/false)? Spinning this
off into a full-blown python class is just ludicrous for something as
fundamental as matrices. If you rewrite that to be implemented via a
straight bint on matrix instances itself, the proper init code of
matrices will become much cheaper and perhaps not a hurdle for 2x2 to
call? In particular, it means the flag could be inited in the
__cinit__ of matrices and hence automatically be initialized.

I'd assume there's very little code that depends explicitly on HOW
matrices keep track of their mutability.

Compared to rewriting 2x2 to not inherit from Matrix (which I think
would indeed be necessary if you want to adhere to protocol: doesn't
inheriting mean relying on the initialization of the class you inherit
from?), making that change might not be so bad and it would benefit
much more of sage.

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