#10320: __len__ still used in polyhedra.py
------------------------+---------------------------------------------------
   Reporter:  jplabbe   |       Owner:  mhampton       
       Type:  defect    |      Status:  new            
   Priority:  major     |   Milestone:  sage-4.6.1     
  Component:  geometry  |    Keywords:  polyhedron, len
     Author:  JP Labbé  |    Upstream:  N/A            
   Reviewer:            |      Merged:                 
Work_issues:            |  
------------------------+---------------------------------------------------
 When you create the 3-dimensional permutahedron by hand (because one could
 use polytopes.permutahedron(4) instead), this yields an AttributeError.
 The __init__ function of Polyhedron uses the function len(x), but it has
 been removed.

 {{{
 sage: P=Polyhedron(Permutations([1,2,3,4]))
 ----------------------------------
 AttributeError     Traceback (most recent call last)

 sage-4.6/<ipython console> in <module>()

 sage-4.6/local/lib/python2.6/site-packages/sage/geometry
 /polyhedra.pyc in __init__(self, vertices, rays, lines, ieqs, eqns,
 field, compute_adjacency, verbose)
    1507
    1508         # Clean up the arguments
 -> 1509         vertices = _set_to_None_if_empty(vertices)
    1510         rays     = _set_to_None_if_empty(rays)
    1511         lines    = _set_to_None_if_empty(lines)

 sage-4.6/local/lib/python2.6/site-packages/sage/geometry
 /polyhedra.pyc in _set_to_None_if_empty(x)
     184     """
     185     if x==None: return x
 --> 186     if len(x)==0: return None
     187     return x
     188

 sage-4.6/local/lib/python2.6/site-packages/sage/combinat
 /combinat.pyc in __len__(self)
     888             AttributeError: __len__ has been removed; use
 .cardinality() instead
     889         """
 --> 890         raise AttributeError, "__len__ has been removed; use
 .cardinality() instead"
     891
     892     def count(self):

 AttributeError: __len__ has been removed; use .cardinality() instead
 sage:
 }}}

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