This is not general, but if M is your matrix, the code 'matrix(R, m,  
n, list(M))' is pretty easy.

Nick

On 4-Mar-08, at 10:59 AM, Jason Grout wrote:

>
> This morning I tried to copy a matrix output, edit it, and create a  
> new
> matrix.  It was frustrating because there seemed to be no way to  
> easily
> cut and paste output into input.  This afternoon a person I was  
> showing
> Sage to also had the same concern.
>
> There has been discussion before on the python convention of str  
> versus
> repr, especially in light of the python docs:
>
> "repr(object)
>      Return a string containing a printable representation of an  
> object.
> This is the same value yielded by conversions (reverse quotes). It is
> sometimes useful to be able to access this operation as an ordinary
> function. For many types, this function makes an attempt to return a
> string that would yield an object with the same value when passed to
> eval()."
>
> For matrices, repr() and str() yield the same output which is pretty
> much useless to try to cut and paste back into input.
>
> Please let me know if
>
>   * I should not implement repr for matrices and graphs in  
> accordance to
> the python docs.
>
>   * There is another function, like the input_form that mabshoff
> suggested on 2386, which could give a code-like representation of an
> object if possible?
>
>
> Thanks,
>
> Jason
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to