#12719: Upgrade to IPython 0.13
----------------------------------------------------------+-----------------
       Reporter:  kini                                    |         Owner:  tbd 
                                             
           Type:  enhancement                             |        Status:  
needs_review                                     
       Priority:  critical                                |     Milestone:  
sage-5.4                                         
      Component:  packages                                |    Resolution:      
                                             
       Keywords:  sd40.5                                  |   Work issues:  
ship https://github.com/ipython/ipython/pull/2403
Report Upstream:  N/A                                     |     Reviewers:  
Volker Braun, Mike Hansen, Jason Grout           
        Authors:  Mike Hansen, Volker Braun, Jason Grout  |     Merged in:      
                                             
   Dependencies:  #13459                                  |      Stopgaps:      
                                             
----------------------------------------------------------+-----------------

Comment (by jhpalmieri):

 I don't understand the `sage0.py` failure. Does the new IPython have a
 different default print representation for some objects? Before the
 patches here:
 {{{
 sage: a = 4
 sage: a.gcd
 <built-in method gcd of sage.rings.integer.Integer object at 0x480e330>
 sage: a.gcd?
 Type:           builtin_function_or_method
 Base Class:     <type 'builtin_function_or_method'>
 String Form:    <built-in method gcd of sage.rings.integer.Integer object
 at 0x480e330>
 Namespace:      Interactive
 Definition:     a.gcd(self, n)
 Docstring:
      ...
 }}}
 With the patches:
 {{{
 sage: a = 4
 sage: a.gcd
 <function gcd>
 sage: a.gcd?
 Type:       builtin_function_or_method
 String Form:<built-in method gcd of sage.rings.integer.Integer object at
 0x5b7c5a0>
 Definition: a.gcd(self, n)
 Docstring:
    ...
 }}}
 With the old version, the print rep for `a.gcd` is the same as what's
 labeled the "String Form" when you do `a.gcd?`. With the new version, the
 print rep has changed but the "String Form" has not. I'm also confused by
 this behavior (with the patches):
 {{{
 sage: a = 4
 sage: G = a.gcd
 sage: G.__repr__()
 '<built-in method gcd of sage.rings.integer.Integer object at 0x4b685a0>'
 sage: G
 <function gcd>
 sage: str(G)
 '<built-in method gcd of sage.rings.integer.Integer object at 0x4b685a0>'
 }}}
 Why isn't `G` printed using its `__repr__` method?

 I've tried out some other objects (e.g., matrices and elements of the
 Steenrod algebra) and my guess is that the print representations for
 methods defined in pyx files are getting changed to `<function ...>`,
 while those defined in py files haven't changed. Any ideas why? Looking at
 `ipython-0.10.2.p1/src/IPython/UserConfig/ipythonrc`, I see the
 configuration option `object_info_string_level 0`, which looks relevant,
 but we're not using this style of configuration, right?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12719#comment:144>
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