From 9a5d67ab5b0e8bf6515061486ce41042c89b9dac Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 4 Nov 2018 01:26:19 -0400 Subject: [PATCH] symbol_sequence.py: use xrange where applicable. --- mjo/symbol_sequence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mjo/symbol_sequence.py b/mjo/symbol_sequence.py index b7c438f..2abf41b 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(5) ) + sage: p = sum( a[i]*x^i for i in xrange(5) ) sage: p a_4*x^4 + a_3*x^3 + a_2*x^2 + a_1*x + a_0 @@ -57,7 +57,7 @@ class SymbolSequence: a_0_1_2 sage: latex(a[0,1,2]) a_{0}_{1}_{2} - sage: [ a[i,j] for i in range(0,2) for j in range(0,2) ] + sage: [ a[i,j] for i in xrange(2) for j in xrange(2) ] [a_0_0, a_0_1, a_1_0, a_1_1] You can pass slices instead of integers to obtain a list of @@ -283,7 +283,7 @@ class SymbolSequence: # If the user asks for a slice, we'll be returning a list # of symbols. return [ self._subscript_integer_(idx) - for idx in range(start, s.stop, step) ] + for idx in xrange(start, s.stop, step) ] -- 2.43.2