@@ -517,7 +517,7 @@ def __classcall__(self, p=2, basis='milnor', **kwds):
517
517
return super ().__classcall__ (self , p = p , basis = std_basis , profile = std_profile ,
518
518
truncation_type = std_type , generic = std_generic )
519
519
520
- def __init__ (self , p = 2 , basis = 'milnor' , ** kwds ):
520
+ def __init__ (self , p = 2 , basis = 'milnor' , ** kwds ) -> None :
521
521
r"""
522
522
INPUT:
523
523
@@ -692,7 +692,7 @@ def prime(self):
692
692
"""
693
693
return self ._prime
694
694
695
- def basis_name (self ):
695
+ def basis_name (self ) -> str :
696
696
r"""
697
697
The basis name associated to ``self``.
698
698
@@ -707,7 +707,7 @@ def basis_name(self):
707
707
"""
708
708
return self .prefix ()
709
709
710
- def _has_nontrivial_profile (self ):
710
+ def _has_nontrivial_profile (self ) -> bool :
711
711
r"""
712
712
Return ``True`` if the profile function for this algebra seems to be that
713
713
for a proper sub-Hopf algebra of the Steenrod algebra.
@@ -744,7 +744,7 @@ def _has_nontrivial_profile(self):
744
744
or (profile [1 ] and min (profile [1 ]) == 1 )))
745
745
or (trunc < Infinity ))
746
746
747
- def _repr_ (self ):
747
+ def _repr_ (self ) -> str :
748
748
r"""
749
749
Printed representation of the Steenrod algebra.
750
750
@@ -799,7 +799,7 @@ def abridge_list(l):
799
799
return "sub-Hopf algebra of %smod %d Steenrod algebra, %s basis, profile function %s" % (genprefix , self .prime (), self ._basis_name , pro_str )
800
800
return "%smod %d Steenrod algebra, %s basis" % (genprefix , self .prime (), self ._basis_name )
801
801
802
- def _latex_ (self ):
802
+ def _latex_ (self ) -> str :
803
803
r"""
804
804
LaTeX representation of the Steenrod algebra.
805
805
@@ -813,7 +813,7 @@ def _latex_(self):
813
813
"""
814
814
return "\\ mathcal{A}_{%s}" % self .prime ()
815
815
816
- def _repr_term (self , t ):
816
+ def _repr_term (self , t ) -> str :
817
817
r"""
818
818
String representation of the monomial specified by the tuple ``t``.
819
819
@@ -2405,17 +2405,15 @@ def Q_exp(self, *nums):
2405
2405
if self .basis_name () != 'milnor' :
2406
2406
return self (SteenrodAlgebra (p = self .prime (),
2407
2407
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
+
2410
2413
if not self ._generic :
2411
- return self .P (* nums )
2414
+ return self .P (* lnums )
2412
2415
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 )
2419
2417
return self .Q (* mono )
2420
2418
2421
2419
def Q (self , * nums ):
0 commit comments