Skip to content

Commit 2dd2332

Browse files
committed
Fixing bug with element_in_conjugacy_classes() error message.
1 parent fb82b76 commit 2dd2332

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sage/combinat/permutation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7143,12 +7143,16 @@ def element_in_conjugacy_classes(self, nu):
71437143
sage: PP = Permutations(5)
71447144
sage: PP.element_in_conjugacy_classes([2,2]) # optional - sage.combinat
71457145
[2, 1, 4, 3, 5]
7146+
sage: PP.element_in_conjugacy_classes([5, 5])
7147+
Traceback (most recent call last):
7148+
...
7149+
ValueError: the size of the partition (=10) should be at most the size of the permutations (=5)
71467150
"""
71477151
from sage.combinat.partition import Partition
71487152
nu = Partition(nu)
71497153
if nu.size() > self.n:
7150-
raise ValueError("The size of the partition (=%s) should be lower or equal"
7151-
" to the size of the permutations (=%s)"%(nu.size,self.n))
7154+
raise ValueError("the size of the partition (=%s) should be at most"
7155+
" the size of the permutations (=%s)" % (nu.size(), self.n))
71527156
l = []
71537157
i = 0
71547158
for nui in nu:

0 commit comments

Comments
 (0)