Ticket #11435 (closed defect: fixed)
empty partition causes error for down_list
| Reported by: | pdehaye | Owned by: | sage-combinat |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.7.2 |
| Component: | combinatorics | Keywords: | |
| Cc: | jbandlow | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Nathann Cohen |
| Authors: | Paul-Olivier Dehaye | Merged in: | sage-4.7.2.alpha1 |
| Dependencies: | Stopgaps: |
Description
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:
Attachments
Change History
comment:2 Changed 2 years ago by ncohen
- Status changed from needs_review to positive_review
Good to go :-)
Nathann
comment:4 Changed 2 years ago by jdemeyer
Dear author/reviewer: please add your real name in the Author and Reviewer fields.
Note: See
TracTickets for help on using
tickets.

