Skip to content

Commit d32f8dd

Browse files
committed
suggested details
1 parent 0517c0a commit d32f8dd

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/sage/combinat/colored_permutations.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def __classcall_private__(cls, m, p, n):
478478
return ColoredPermutations(m, n)
479479
return super().__classcall__(cls, m, p, n)
480480

481-
def __init__(self, m, p, n):
481+
def __init__(self, m, p, n) -> None:
482482
r"""
483483
Initialize ``self``.
484484
@@ -509,9 +509,7 @@ def __init__(self, m, p, n):
509509
self._C = IntegerModRing(self._m)
510510
self._P = Permutations(self._n)
511511

512-
if (self._p == 1 and (self._m == 1 or self._m == 2)
513-
or (self._p == 2 and self._m == 2)
514-
or (self._n == 2 and self._p == self._m)):
512+
if self._p <= self._m <= 2 or (self._n == 2 and self._p == self._m):
515513
from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups
516514
category = FiniteCoxeterGroups()
517515
if not (self._n == self._m == self._p == 2): # special case of type D_2
@@ -523,7 +521,7 @@ def __init__(self, m, p, n):
523521
category = category.WellGenerated()
524522
Parent.__init__(self, category=category)
525523

526-
def _repr_(self):
524+
def _repr_(self) -> str:
527525
"""
528526
Return a string representation of ``self``.
529527
@@ -2922,7 +2920,7 @@ class SimpleModule(Representation_abstract, QuotientModuleWithBasis):
29222920
[0 0 0 0 0 0 1 0]
29232921
[0 0 0 0 0 0 0 1]
29242922
"""
2925-
def __init__(self, specht_module):
2923+
def __init__(self, specht_module) -> None:
29262924
r"""
29272925
Initialize ``self``.
29282926
@@ -2932,18 +2930,19 @@ def __init__(self, specht_module):
29322930
sage: D = B4.simple_module([[2,1], [1]], GF(3))
29332931
sage: TestSuite(D).run()
29342932
"""
2935-
self._diagram = specht_module._diagram
29362933
p = specht_module.base_ring().characteristic()
2937-
if (not all(la.is_regular(p) for la in specht_module._diagram)
2938-
or (p == 2 and specht_module._diagram[0])):
2934+
d = self._diagram = specht_module._diagram
2935+
if (p == 2 and d[0]) or not all(la.is_regular(p) for la in d):
29392936
raise ValueError(f"the partition must be {p}-regular")
2940-
Representation_abstract.__init__(self, specht_module._semigroup, specht_module._side,
2937+
Representation_abstract.__init__(self, specht_module._semigroup,
2938+
specht_module._side,
29412939
algebra=specht_module._semigroup_algebra)
29422940
cat = specht_module.category()
2943-
QuotientModuleWithBasis.__init__(self, specht_module.maximal_submodule(),
2941+
QuotientModuleWithBasis.__init__(self,
2942+
specht_module.maximal_submodule(),
29442943
cat, prefix='D', bracket='')
29452944

2946-
def _repr_(self):
2945+
def _repr_(self) -> str:
29472946
r"""
29482947
Return a string representation of ``self``.
29492948
@@ -2955,7 +2954,7 @@ def _repr_(self):
29552954
"""
29562955
return f"Simple module of {self._diagram} over {self.base_ring()}"
29572956

2958-
def _latex_(self):
2957+
def _latex_(self) -> str:
29592958
r"""
29602959
Return a latex representation of ``self``.
29612960

0 commit comments

Comments
 (0)