]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
symbol_sequence.py: use generator expressions where applicable.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 05:25:58 +0000 (01:25 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 4 Nov 2018 05:25:58 +0000 (01:25 -0400)
mjo/symbol_sequence.py

index 63c8316fb9725bb2aab8a91f35dabf3a2e6d854b..b7c438fa02fda1702f6df4fd5a6f1b3a41fce7b0 100644 (file)
@@ -38,7 +38,7 @@ class SymbolSequence:
     degree::
 
         sage: a = SymbolSequence('a')
-        sage: p = sum([ a[i]*x^i for i in range(0,5)])
+        sage: p = sum( a[i]*x^i for i in range(5) )
         sage: p
         a_4*x^4 + a_3*x^3 + a_2*x^2 + a_1*x + a_0
 
@@ -328,8 +328,8 @@ class SymbolSequence:
         # corresponding to the second coordinate, with the first
         # coordinate(s) fixed.
         if isinstance(key, slice):
-            ss = [ SymbolSequence(w._repr_(), w._latex_(), self._domain)
-                   for w in v ]
+            ss = ( SymbolSequence(w._repr_(), w._latex_(), self._domain)
+                   for w in v )
 
             # This might be nested...
             maybe_nested_list = [ s._subscript_tuple_(args) for s in ss ]