Opened 10 years ago
Closed 10 years ago
#11370 closed defect (fixed)
permutation.to_standard() breaks on empty permutations
Reported by: | hivert | Owned by: | sage-combinat |
---|---|---|---|
Priority: | major | Milestone: | sage-4.7.1 |
Component: | combinatorics | Keywords: | Standard permutation |
Cc: | combinat | Merged in: | sage-4.7.1.alpha3 |
Authors: | Florent Hivert | Reviewers: | Mike Hansen |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Yet another empty object problem
sage: sage.combinat.permutation.to_standard([]) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /home/data/Sage-Install/sage-4.6.2/devel/sage-combinat/sage/combinat/<ipython console> in <module>() /home/florent/src/Sage/sage/local/lib/python2.6/site-packages/sage/combinat/permutation.pyc in to_standard(p) 4243 4244 s = p[:] -> 4245 biggest = max(p) + 1 4246 i = 1 4247 for _ in range(len(p)): ValueError: max() arg is an empty sequence
should be
[]
I also fixed the return type of {{{from_reduced_word([])}}.
Attachments (1)
Change History (7)
comment:1 Changed 10 years ago by
- Description modified (diff)
comment:2 Changed 10 years ago by
- Cc combinat added
Changed 10 years ago by
comment:3 Changed 10 years ago by
- Reviewers set to Mike Hansen
- Status changed from new to needs_review
Looks good to me.
comment:4 Changed 10 years ago by
- Status changed from needs_review to positive_review
comment:5 Changed 10 years ago by
Thanks Mike.
comment:6 Changed 10 years ago by
- Merged in set to sage-4.7.1.alpha3
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Should be ready for review.