From 2dd23322330b8a1234fa2927c3d75eeb71c863ea Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 9 Sep 2023 16:05:56 +0900 Subject: [PATCH] Fixing bug with element_in_conjugacy_classes() error message. --- src/sage/combinat/permutation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index a216ad58029..459364f6121 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -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: