Javier,

> def _sage_(self):
>         """
>         Override of ExpectElement._sage_ method. Aiming for a better
> conversion. Initially just for matrices!
>         """
>         if self.IsMatrix():
>             ring = self[1,1].Ring().sage()

This is not good enough. It could be that the [1,1]-element lies in a
proper subring.
One should either test each matrix entry and take the biggest ring, or
ask GAP to do it for you.
Say, if A is a GAP matrix you can do
gap> Field(Flat(A));
to get the smallest field containing all the entries of A.


>             return self._matrix_(ring)
>         else:    # If we don't know how to deal with this, return to
> the default.
>             return ExpectElement._sage_(self)
>
[...]

Dima
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to