#9683: pretty_print clobbers _ (history)
-----------------------------------------+----------------------------------
       Reporter:  mguaypaq               |         Owner:  was     
           Type:  defect                 |        Status:  new     
       Priority:  major                  |     Milestone:  sage-5.6
      Component:  user interface         |    Resolution:          
       Keywords:  pretty_print, history  |   Work issues:          
Report Upstream:  N/A                    |     Reviewers:          
        Authors:                         |     Merged in:          
   Dependencies:                         |      Stopgaps:          
-----------------------------------------+----------------------------------

Comment (by iandrus):

 In the  ipython `displayhook` it checks to see if underscore was set
 explicitly and if so, it stops tracking.  We are setting it explicitly in
 `pretty_print`.  Maybe if we just stop doing this it will work.  Also we
 probably need to fix `pretty_print_default` to set it to the ipython
 `displayhook` instead of the default one.

 {{{
     def check_for_underscore(self):
         """Check if the user has set the '_' variable by hand."""
         # If something injected a '_' variable in __builtin__, delete
         # ipython's automatic one so we don't clobber that.  gettext() in
         # particular uses _, so we need to stay away from it.
         if '_' in __builtin__.__dict__:
             try:
                 del self.shell.user_ns['_']
             except KeyError:
                 pass
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9683#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en.

Reply via email to