#8648: Generic __call__ function for parents prevents empty input in constructor
--------------------------+-------------------------------------------------
   Reporter:  aschilling  |       Owner:  robertwb           
       Type:  defect      |      Status:  new                
   Priority:  major       |   Milestone:                     
  Component:  coercion    |    Keywords:  element constructor
     Author:              |    Upstream:  N/A                
   Reviewer:              |      Merged:                     
Work_issues:              |  
--------------------------+-------------------------------------------------
 Generic __call__ function for parents has a default value for its first
 argument. This prevents from making a difference between A() and A(0).
 This causes problems for crystal code, where the typical input is
 A(2,1,4,3,0,...). For example:

 {{{
     sage: T = CrystalOfTableaux(['B',3], shape=[3])
     sage: t=T(1,2,0)
     sage: t
     [[1, 2, 0]]

     sage: T = CrystalOfTableaux(['B',3], shape=[])
     sage: t=T()
     sage: t     # goes boom
     sage: t._list # this list should be empty
     [0]
 }}}

 Suggestion: self.__call__() could instead call right away
 self._element_constructor_().

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