Skip to content

Commit 9a2ae89

Browse files
committed
fix suggested details
1 parent 1f6e822 commit 9a2ae89

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/sage/algebras/steenrod/steenrod_algebra.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def __classcall__(self, p=2, basis='milnor', **kwds):
517517
return super().__classcall__(self, p=p, basis=std_basis, profile=std_profile,
518518
truncation_type=std_type, generic=std_generic)
519519

520-
def __init__(self, p=2, basis='milnor', **kwds):
520+
def __init__(self, p=2, basis='milnor', **kwds) -> None:
521521
r"""
522522
INPUT:
523523
@@ -692,7 +692,7 @@ def prime(self):
692692
"""
693693
return self._prime
694694

695-
def basis_name(self):
695+
def basis_name(self) -> str:
696696
r"""
697697
The basis name associated to ``self``.
698698
@@ -707,7 +707,7 @@ def basis_name(self):
707707
"""
708708
return self.prefix()
709709

710-
def _has_nontrivial_profile(self):
710+
def _has_nontrivial_profile(self) -> bool:
711711
r"""
712712
Return ``True`` if the profile function for this algebra seems to be that
713713
for a proper sub-Hopf algebra of the Steenrod algebra.
@@ -744,7 +744,7 @@ def _has_nontrivial_profile(self):
744744
or (profile[1] and min(profile[1]) == 1)))
745745
or (trunc < Infinity))
746746

747-
def _repr_(self):
747+
def _repr_(self) -> str:
748748
r"""
749749
Printed representation of the Steenrod algebra.
750750
@@ -799,7 +799,7 @@ def abridge_list(l):
799799
return "sub-Hopf algebra of %smod %d Steenrod algebra, %s basis, profile function %s" % (genprefix, self.prime(), self._basis_name, pro_str)
800800
return "%smod %d Steenrod algebra, %s basis" % (genprefix, self.prime(), self._basis_name)
801801

802-
def _latex_(self):
802+
def _latex_(self) -> str:
803803
r"""
804804
LaTeX representation of the Steenrod algebra.
805805
@@ -813,7 +813,7 @@ def _latex_(self):
813813
"""
814814
return "\\mathcal{A}_{%s}" % self.prime()
815815

816-
def _repr_term(self, t):
816+
def _repr_term(self, t) -> str:
817817
r"""
818818
String representation of the monomial specified by the tuple ``t``.
819819
@@ -2405,17 +2405,15 @@ def Q_exp(self, *nums):
24052405
if self.basis_name() != 'milnor':
24062406
return self(SteenrodAlgebra(p=self.prime(),
24072407
generic=self._generic).Q_exp(*nums))
2408-
while nums[-1] == 0:
2409-
nums = nums[:-1]
2408+
2409+
lnums = list(nums)
2410+
while lnums[-1] == 0:
2411+
lnums.pop()
2412+
24102413
if not self._generic:
2411-
return self.P(*nums)
2414+
return self.P(*lnums)
24122415

2413-
mono = ()
2414-
index = 0
2415-
for e in nums:
2416-
if e == 1:
2417-
mono = mono + (index,)
2418-
index += 1
2416+
mono = (index for index, e in enumerate(lnums) if e == 1)
24192417
return self.Q(*mono)
24202418

24212419
def Q(self, *nums):

0 commit comments

Comments
 (0)