#11435: empty partition causes error for down_list
-----------------------------+----------------------------------------------
Reporter: pdehaye | Owner: sage-combinat
Type: defect | Status: new
Priority: major | Milestone: sage-4.7.1
Component: combinatorics | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-----------------------------+----------------------------------------------
{{{
sage: p = Partition([])
sage: p.down_list()
---------------------------------------------------------------------------
IndexError Traceback (most recent call
last)
/Volumes/Scratch/Users/duser1/sage/<ipython console> in <module>()
/Users/duser1/sage/local/lib/python2.6/site-
packages/sage/combinat/partition.pyc in down_list(self)
643 [[2, 2, 1], [3, 1, 1], [3, 2]]
644 """
--> 645 return [p for p in self.down()]
646
647 def dominates(self, p2):
/Users/duser1/sage/local/lib/python2.6/site-
packages/sage/combinat/partition.pyc in down(self)
622 yield Partition(p[:i] + [ p[i]-1 ] + p[i+1:])
623
--> 624 last = p[-1]
625 if last == 1:
626 yield Partition(p[:-1])
/Users/duser1/sage/local/lib/python2.6/site-
packages/sage/combinat/combinat.pyc in __getitem__(self, key)
905 <type 'list'>
906 """
--> 907 return self._list.__getitem__(key)
908
909 def __iter__(self):
IndexError: list index out of range
sage:
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11435>
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.