> ah. I try to avoid using __repr__ because i was told that this is
> supposed to return a string from which the object can be reconstructed
> -- and i certainly don't want to go through all that trouble just for
> what i need. Do you know what happens if __repr__ simply returns the
> same as __str__ ?

There is no problem having __repr__ and __str__ do the same thing.
Sage breaks the conventions that __repr__ is a string from which the
object can be reconstructed due to the complexity of the objects in
Sage.

If you do

sage: a

Then, the ipython interpreter will call the __repr__ method to display
the object a.

--Mike

--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to