#12071: Call `__init__` of base classes
-----------------------------+----------------------------------------------
   Reporter:  SimonKing      |          Owner:  tbd                
       Type:  PLEASE CHANGE  |         Status:  new                
   Priority:  critical       |      Milestone:  sage-4.8           
  Component:  performance    |       Keywords:  base class __init__
Work_issues:                 |       Upstream:  N/A                
   Reviewer:                 |         Author:                     
     Merged:                 |   Dependencies:  #11900             
-----------------------------+----------------------------------------------
 Base classes are useful, and they are used. They would be even more useful
 if one would call their `__init__` - but that's often not done in Sage.

 For example, even though the class of continued fraction field inherits
 from the base class `sage.rings.ring.Field`, it used to only call
 `ParentWithGens.__init__`. That is very annoying, since by #9138
 `Field.__init__` would automatically initialise the correct category.

 I fixed a couple of cases at #11900, so, I make this a dependency.
 Hoewever, according to search_src, there are still many cases left that
 needs to be looked at:
 {{{
 tensor/differential_forms.py:110:        ParentWithGens.__init__(self, SR,
 \
 groups/group.pyx:55:
 sage.structure.parent_gens.ParentWithGens.__init__(self,
 rings/real_mpfi.pyx:451:        ParentWithGens.__init__(self, self,
 tuple([]), False, category = Fields())
 rings/multi_power_series_ring.py:305:        ParentWithGens.__init__(self,
 base_ring, name_list)
 rings/complex_field.py:185:        ParentWithGens.__init__(self,
 self._real_field(), ('I',), False, category = Fields())
 rings/integer_ring.pyx:236:        ParentWithGens.__init__(self, self,
 ('x',), normalize=False, category = EuclideanDomains())
 rings/complex_mpc.pyx:297:        ParentWithGens.__init__(self,
 self._real_field(), ('I',), False)
 rings/complex_double.pyx:158:        ParentWithGens.__init__(self, self,
 ('I',), normalize=False, category = Fields())
 rings/complex_interval_field.py:144:        ParentWithGens.__init__(self,
 self._real_field(), ('I',), False, category = Fields())
 rings/infinity.py:472:        ParentWithGens.__init__(self, self,
 names=('oo',), normalize=False)
 rings/infinity.py:783:        ParentWithGens.__init__(self, self,
 names=('oo',), normalize=False)
 rings/real_mpfr.pyx:308:        ParentWithGens.__init__(self, self,
 tuple([]), False, category = Fields())
 rings/rational_field.py:213:        ParentWithGens.__init__(self, self,
 category = QuotientFields())
 rings/number_field/number_field.py:1005:
 ParentWithGens.__init__(self, QQ, name, category=category)
 coding/linear_code.py:706:        ParentWithGens.__init__(self, base_ring)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12071>
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