From: Michael Orlitzky Date: Sun, 4 Nov 2018 05:25:58 +0000 (-0400) Subject: symbol_sequence.py: use generator expressions where applicable. X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0f82bb9c56eb8c7069e20e1948504deac213169e;p=sage.d.git symbol_sequence.py: use generator expressions where applicable. --- diff --git a/mjo/symbol_sequence.py b/mjo/symbol_sequence.py index 63c8316..b7c438f 100644 --- a/mjo/symbol_sequence.py +++ b/mjo/symbol_sequence.py @@ -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 ]