@@ -174,7 +174,7 @@ def _call_(self, x):
174174 if M .base_ring () != self .base_ring ():
175175 M = M .change_ring (self .base_ring ())
176176 except (TypeError , AttributeError ) as msg :
177- raise TypeError ("%s\n unable to coerce x (=%s) into %s" % (msg ,x , self ))
177+ raise TypeError ("%s\n unable to coerce x (=%s) into %s" % (msg , x , self ))
178178 return M
179179
180180 def is_abelian (self ):
@@ -582,7 +582,7 @@ def module_morphism(self, on_basis=None, matrix=None, function=None,
582582 return ModuleMorphismByLinearity (
583583 domain = self , on_basis = on_basis , ** keywords )
584584 else :
585- return ModuleMorphismFromFunction ( # Or just SetMorphism?
585+ return ModuleMorphismFromFunction ( # Or just SetMorphism?
586586 domain = self , function = function , ** keywords )
587587
588588 _module_morphism = module_morphism
@@ -1265,7 +1265,7 @@ def _apply_module_morphism(self, x, on_basis, codomain=False):
12651265 except Exception :
12661266 raise ValueError ('codomain could not be determined' )
12671267
1268- if hasattr ( codomain , 'linear_combination' ):
1268+ if hasattr (codomain , 'linear_combination' ):
12691269 mc = x .monomial_coefficients (copy = False )
12701270 return codomain .linear_combination ((on_basis (key ), coeff )
12711271 for key , coeff in mc .items ())
@@ -1289,8 +1289,8 @@ def _apply_module_endomorphism(self, x, on_basis):
12891289 2*s[2, 1] + 2*s[3]
12901290 """
12911291 mc = x .monomial_coefficients (copy = False )
1292- return self .linear_combination ( (on_basis (key ), coeff )
1293- for key , coeff in mc .items ())
1292+ return self .linear_combination ((on_basis (key ), coeff )
1293+ for key , coeff in mc .items ())
12941294
12951295 def dimension (self ):
12961296 """
@@ -2183,7 +2183,7 @@ def map_support(self, f):
21832183 sage: y.parent() is B # needs sage.modules
21842184 True
21852185 """
2186- return self .parent ().sum_of_terms ( (f (m ), c ) for m ,c in self )
2186+ return self .parent ().sum_of_terms ((f (m ), c ) for m , c in self )
21872187
21882188 def map_support_skip_none (self , f ):
21892189 """
@@ -2217,7 +2217,9 @@ def map_support_skip_none(self, f):
22172217 sage: y.parent() is B # needs sage.modules
22182218 True
22192219 """
2220- return self .parent ().sum_of_terms ( (fm ,c ) for (fm ,c ) in ((f (m ), c ) for m ,c in self ) if fm is not None )
2220+ return self .parent ().sum_of_terms ((fm , c )
2221+ for fm , c in ((f (m ), c ) for m , c in self )
2222+ if fm is not None )
22212223
22222224 def map_item (self , f ):
22232225 """
@@ -2251,7 +2253,7 @@ def map_item(self, f):
22512253 sage: a.map_item(f) # needs sage.combinat sage.modules
22522254 2*s[2, 1] + 2*s[3]
22532255 """
2254- return self .parent ().sum_of_terms ( f (m ,c ) for m ,c in self )
2256+ return self .parent ().sum_of_terms (f (m , c ) for m , c in self )
22552257
22562258 def tensor (* elements ):
22572259 """
@@ -2587,11 +2589,13 @@ def apply_multilinear_morphism(self, f, codomain=None):
25872589 except AttributeError :
25882590 codomain = f (* [module .zero () for module in modules ]).parent ()
25892591 if codomain in ModulesWithBasis (K ):
2590- return codomain .linear_combination ((f (* [module .monomial (t ) for (module ,t ) in zip (modules , m )]), c )
2591- for m ,c in self )
2592+ return codomain .linear_combination ((f (* [module .monomial (t )
2593+ for module , t in zip (modules , m )]), c )
2594+ for m , c in self )
25922595 else :
2593- return sum ((c * f (* [module .monomial (t ) for (module ,t ) in zip (modules , m )])
2594- for m ,c in self ),
2596+ return sum ((c * f (* [module .monomial (t )
2597+ for module , t in zip (modules , m )])
2598+ for m , c in self ),
25952599 codomain .zero ())
25962600
25972601 class DualObjects (DualObjectsCategory ):
0 commit comments