Opened 11 years ago

Closed 11 years ago

#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 Merged in: sage-4.7.2.alpha1
Authors: Paul-Olivier Dehaye Reviewers: Nathann Cohen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

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 (1)

trac_11435-Downlist_on_empty_partition-pod.patch (1.6 KB) - added by pdehaye 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by pdehaye

  • Status changed from new to needs_review

fixed

comment:2 Changed 11 years ago by ncohen

  • Status changed from needs_review to positive_review

Good to go :-)

Nathann

comment:3 Changed 11 years ago by jdemeyer

  • Milestone changed from sage-4.7.1 to sage-4.7.2

comment:4 Changed 11 years ago by jdemeyer

Dear author/reviewer: please add your real name in the Author and Reviewer fields.

comment:5 Changed 11 years ago by ncohen

  • Authors set to Paul-Olivier Dehaye
  • Reviewers set to Nathann Cohen

comment:6 Changed 11 years ago by jdemeyer

  • Merged in set to sage-4.7.2.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.