Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty partition causes error for down_list #11435

Closed
pdehaye mannequin opened this issue Jun 6, 2011 · 6 comments
Closed

empty partition causes error for down_list #11435

pdehaye mannequin opened this issue Jun 6, 2011 · 6 comments

Comments

@pdehaye
Copy link
Mannequin

pdehaye mannequin commented Jun 6, 2011

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: 

CC: @jbandlow

Component: combinatorics

Author: Paul-Olivier Dehaye

Reviewer: Nathann Cohen

Merged: sage-4.7.2.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/11435

@pdehaye pdehaye mannequin added this to the sage-4.7.1 milestone Jun 6, 2011
@pdehaye pdehaye mannequin added c: combinatorics labels Jun 6, 2011
@pdehaye
Copy link
Mannequin Author

pdehaye mannequin commented Jun 7, 2011

comment:1

Attachment: trac_11435-Downlist_on_empty_partition-pod.patch.gz

fixed

@pdehaye pdehaye mannequin added the s: needs review label Jun 7, 2011
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 14, 2011

comment:2

Good to go :-)

Nathann

@jdemeyer
Copy link

comment:4

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

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 19, 2011

Author: Paul-Olivier Dehaye

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 19, 2011

Reviewer: Nathann Cohen

@jdemeyer
Copy link

jdemeyer commented Aug 3, 2011

Merged: sage-4.7.2.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant