Am Donnerstag, 30. April 2015 05:56:11 UTC+2 schrieb Volker Braun:
>
> On Wednesday, April 29, 2015 at 11:37:38 PM UTC-4, Martin R wrote:
>>
>> Oh, now that's an explanation!  So the explanation in the third post on 
>> this thread,
>>     displayhook: calls __repr__ on the value of the last statement and 
>> sends to stdout
>>
> was a bit misleading. 
>>
>
> Well that was about plain Python...
>

I'm only trying to understand.  Yes, I assume it happens that someone is 
using sage as a python library and then possibly only wants repr.
 

> Thanks for clarifying.  (In turn, this begs the question, when is repr 
>> used for display instead of rich_repr?)
>>
>
> _repr_ is used if an object does not implement _rich_repr_ or if 
> _rich_repr_ does not return anything.
>

OK, so if I'm not mistaken, _repr_ is for the use case just mentioned 
above, right? 

So the point really is that, at least for me personally, having rich_repr 
>> return graphics in the console (for any object, not only graphs) is very 
>> very undesirable.
>>
>
> Presumably you find it desirable to display Graphics() objects (the return 
> value of plot()) as picture, so there is that.
>

Of course.  Hence, _rich_repr_ (or _repr_) should not return a Graphics 
object, right?.

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to