Dear William > Maybe. I'm not convinced it's better. It's usually good when people > write code, they do > > try: > ... > except (Specific, Tuple, Of, Exceptions): > code > > and *never* > > try: > ... > except: > ...
Yes... This was perfectly clear to me. And that's why I volunteered to makes things coherent. > is that it suggests there is exactly one exception for all types of > errors involving linear algebra. But I can at least see situations > where ValueError and ZeroDivisionError at least both make sense, so > doing the above would presumably merge them. > > So I'm definitely not a priori convinced that LinAlgError is > necessarily better. Ok ! You get the point. I'm really sorry to encumber the mailing list, but I think, to ensure the quality of sage, things like that should be discussed and fixed once for all. Moreover since I'm new to sage, I don't want to make a decision which goes against the usual behavior of sage. So let me summarize the decisions. For any rings 1. The 0x0 matrix is its self inverse and has 1 for determinant. 2. Any nx0 or 0xn (n != 0) matrix is not invertible and should raise a ValueError "matrix must be square" if one tries to invert it. I'll add support for this in the file matrix0.pyx. I'll also try to make generic test for this behavior. 3. Any singular matrix when inverted should raise a DivisionByZero Error. In numpy case this probably means catching an exception to launch a different one. Am I right ? Any last comment ? After dealing with this I'll have go back to combinatorics otherwise I'll never be able to use sage for my own research :-). Cheers, Florent --~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---