summaryrefslogtreecommitdiffstats
path: root/Demo/classes/Range.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/classes/Range.py
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/classes/Range.py')
-rwxr-xr-xDemo/classes/Range.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Demo/classes/Range.py b/Demo/classes/Range.py
index 3f1daae..0f84157 100755
--- a/Demo/classes/Range.py
+++ b/Demo/classes/Range.py
@@ -60,7 +60,7 @@ class oldrange:
if 0 <= i <= self.len:
return self.start + self.step * i
else:
- raise IndexError, 'range[i] index out of range'
+ raise IndexError('range[i] index out of range')
def test():
@@ -73,7 +73,7 @@ def test():
raise Exception("error in implementation:\ncorrect = %s"
"\nold-style = %s\ngenerator = %s" %
(correct_result, oldrange_result, genrange_result))
- print "Timings for range(1000):"
+ print("Timings for range(1000):")
t1 = time.time()
for i in oldrange(1000):
pass
@@ -84,9 +84,9 @@ def test():
for i in __builtin__.range(1000):
pass
t4 = time.time()
- print t2-t1, 'sec (old-style class)'
- print t3-t2, 'sec (generator)'
- print t4-t3, 'sec (built-in)'
+ print(t2-t1, 'sec (old-style class)')
+ print(t3-t2, 'sec (generator)')
+ print(t4-t3, 'sec (built-in)')
if __name__ == '__main__':