On Feb 17, 2009, at 6:57 PM, Alasdair wrote:
>
> Yes, you can certainly turn on the behaviour in Sage by writing your
> last line as a function:
>
> def parent_on():
> ipapi.get().set_hook("result_display", repr_and_parent)
>
> However, I still haven't worked out how to write the corresponding
> parent_off() function...
You could probably do
def parent_on():
ipapi.get().set_hook("result_display", repr)
>
> -Alasdair
>
> On Feb 18, 1:07 pm, Mike Hansen <[email protected]> wrote:
>> On Tue, Feb 17, 2009 at 6:00 PM, Alasdair <[email protected]> wrote:
>>
>>> Yes, that works fine - thank you very much! Is there a way of
>>> turning
>>> such behavior on and off from within Sage?
>>
>> Not automatically. You just need to write a little function that
>> swaps the repr_and_parent hook with
>> IPython.hooks.result_display (which is the default).
>>
>> --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
-~----------~----~----~----~------~----~------~--~---