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

allow construction of empty signed permutation #30667

Closed
mantepse opened this issue Sep 26, 2020 · 10 comments
Closed

allow construction of empty signed permutation #30667

mantepse opened this issue Sep 26, 2020 · 10 comments

Comments

@mantepse
Copy link
Contributor

Define signed permutations on zero elements:

sage: S = SignedPermutations(0)
sage: S
Signed permutations of 0

Before this ticket:

sage: S([])
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
...
~/sage-develop/local/lib/python3.8/site-packages/sage/combinat/colored_permutations.py in _element_constructor_(self, x)
   1190         """
   1191         if isinstance(x, list):
-> 1192             if isinstance(x[0], tuple):
   1193                 c = []
   1194                 p = []

IndexError: list index out of range

After this ticket:

sage: S([])
[]

CC: @slel @tscrim

Component: combinatorics

Author: Martin Rubey

Branch/Commit: e807d8e

Reviewer: Samuel Lelièvre

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

@mantepse mantepse added this to the sage-9.2 milestone Sep 26, 2020
@mantepse
Copy link
Contributor Author

@mantepse
Copy link
Contributor Author

Author: Martin Rubey

@mantepse
Copy link
Contributor Author

Commit: e807d8e

@mantepse

This comment has been minimized.

@slel
Copy link
Member

slel commented Sep 26, 2020

Reviewer: Samuel Lelièvre

@slel
Copy link
Member

slel commented Sep 26, 2020

comment:3

Good.

@slel

This comment has been minimized.

@slel

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Sep 27, 2020

comment:6

Yay corner cases! Good catch and fix. Thanks.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@vbraun
Copy link
Member

vbraun commented Oct 31, 2020

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

5 participants