Skip to content

Commit

Permalink
Fixing bug with element_in_conjugacy_classes() error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
tscrim committed Sep 9, 2023
1 parent fb82b76 commit 2dd2332
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sage/combinat/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7143,12 +7143,16 @@ def element_in_conjugacy_classes(self, nu):
sage: PP = Permutations(5)
sage: PP.element_in_conjugacy_classes([2,2]) # optional - sage.combinat
[2, 1, 4, 3, 5]
sage: PP.element_in_conjugacy_classes([5, 5])
Traceback (most recent call last):
...
ValueError: the size of the partition (=10) should be at most the size of the permutations (=5)
"""
from sage.combinat.partition import Partition
nu = Partition(nu)
if nu.size() > self.n:
raise ValueError("The size of the partition (=%s) should be lower or equal"
" to the size of the permutations (=%s)"%(nu.size,self.n))
raise ValueError("the size of the partition (=%s) should be at most"
" the size of the permutations (=%s)" % (nu.size(), self.n))
l = []
i = 0
for nui in nu:
Expand Down

0 comments on commit 2dd2332

Please sign in to comment.