Dear All,
The patch is close to be ready to submission. However I'm not sure if the
two last answer was from this mail or another one.
> As you suggested in your previous e-mail, there is a last chance that can save
> us: what about creating a new exception say MatrixFormatError which inherits
> both ArithmeticError and ValueError. It has the advantage of preserving the
> backward compatibility, to be explicit, and if needed one can later on issue a
> deprecation warning and remove the inheritance from ArithmeticError.
>
> class MatrixFormatError(ArithmeticError, ValueError):
> def __init__(self, value):
> self.value = value
> def __str__(self):
> return repr(self.value)+"(Warning: the inheritance of
> MatrixFormatError from AritmeticError is deprecated)"
>
> But it's probably not worth it... What do you think ?
I had a (visual) chat with Nicolas on that point, and I end up with a
better proposal. There are a lot of places trough sage where two size has to
match. Here are some examples:
- the number of row and column of one or two matrix(ces) for multiplication,
inversion, determinant, characteristic polynomial...
- the number of row and column and the number of variables of a polynomial
when a matrix acts on polynomials.
- the size of two permutations to multiply them.
- The size of a permutations and the number of variable of a polynomial.
...
It seems that all those case are similar and should raise an specific
error. Maybe a SizeMismatchError. We should use the previous trick of
inheriting both from ArithmeticError and Value error to temporarily assure
backward compatibility. And change the thing definitely during a X.0 release
as suggested by Martin.
I can also put my patch as such (only raise Arithmetic Error for matrices) and
prepare another one for the next X.0 release.
Cheers,
Florent
--~--~---------~--~----~------------~-------~--~----~
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/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---