#17533: Clean up parent() and related functions
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.5
      Component:  coercion           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/17533            |  29ce9a14eeb40f3019913c73e0f110896fb35228
   Dependencies:  #10962             |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):

 * status:  needs_review => needs_info


Comment:

 Hello Jeroen,

 1) Why moving "parent_c" and "have_same_parent_c"?

 2) Instead of
 {{{
 cdef inline parent_c(x):
     if isinstance(x, Element):
         return (<Element>x)._parent
     elif hasattr(x, 'parent'):
         return x.parent()
     else:
         return type(x)
 }}}
 wouldn't it be faster to do
 {{{
 cdef inline parent_c(x):
     if isinstance(x, Element):
         return (<Element>x)._parent
     else:
         try:
             return x.parent()
         except AttributeError:
             return type(x)
 }}}

 3) In `element.pyx`, the "seealso" should be a "SEEALSO".

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/17533#comment:9>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to