Commit e0058b60 authored by Tres Seaver's avatar Tres Seaver

MOar range-object madness.

parent 1fc6edb9
...@@ -547,7 +547,7 @@ class MappingBase(Base): ...@@ -547,7 +547,7 @@ class MappingBase(Base):
def testIterators(self): def testIterators(self):
t = self._makeOne() t = self._makeOne()
for keys in [], [-2], [1, 4], range(-170, 2000, 6): for keys in [], [-2], [1, 4], list(range(-170, 2000, 6)):
t.clear() t.clear()
for k in keys: for k in keys:
t[k] = -3 * k t[k] = -3 * k
...@@ -576,7 +576,7 @@ class MappingBase(Base): ...@@ -576,7 +576,7 @@ class MappingBase(Base):
def testRangedIterators(self): def testRangedIterators(self):
t = self._makeOne() t = self._makeOne()
for keys in [], [-2], [1, 4], range(-170, 2000, 13): for keys in [], [-2], [1, 4], list(range(-170, 2000, 13)):
t.clear() t.clear()
values = [] values = []
for k in keys: for k in keys:
...@@ -831,7 +831,7 @@ class BTreeTests(MappingBase): ...@@ -831,7 +831,7 @@ class BTreeTests(MappingBase):
import random import random
t = self._makeOne() t = self._makeOne()
added = {} added = {}
r = range(100) r = list(range(100))
for x in r: for x in r:
k = random.choice(r) k = random.choice(r)
if k not in added: if k not in added:
...@@ -846,7 +846,7 @@ class BTreeTests(MappingBase): ...@@ -846,7 +846,7 @@ class BTreeTests(MappingBase):
import random import random
t = self._makeOne() t = self._makeOne()
added = {} added = {}
r = range(100) r = list(range(100))
for x in r: for x in r:
k = random.choice(r) k = random.choice(r)
t[k] = x t[k] = x
...@@ -859,7 +859,7 @@ class BTreeTests(MappingBase): ...@@ -859,7 +859,7 @@ class BTreeTests(MappingBase):
def testRandomDeletes(self): def testRandomDeletes(self):
import random import random
t = self._makeOne() t = self._makeOne()
r = range(1000) r = list(range(1000))
added = [] added = []
for x in r: for x in r:
k = random.choice(r) k = random.choice(r)
...@@ -884,7 +884,7 @@ class BTreeTests(MappingBase): ...@@ -884,7 +884,7 @@ class BTreeTests(MappingBase):
def testTargetedDeletes(self): def testTargetedDeletes(self):
import random import random
t = self._makeOne() t = self._makeOne()
r = range(1000) r = list(range(1000))
for x in r: for x in r:
k = random.choice(r) k = random.choice(r)
t[k] = x t[k] = x
...@@ -898,7 +898,7 @@ class BTreeTests(MappingBase): ...@@ -898,7 +898,7 @@ class BTreeTests(MappingBase):
def testPathologicalRightBranching(self): def testPathologicalRightBranching(self):
t = self._makeOne() t = self._makeOne()
r = range(1000) r = list(range(1000))
for x in r: for x in r:
t[x] = 1 t[x] = 1
self.assertEqual(realseq(t.keys()) , r, realseq(t.keys())) self.assertEqual(realseq(t.keys()) , r, realseq(t.keys()))
...@@ -909,7 +909,7 @@ class BTreeTests(MappingBase): ...@@ -909,7 +909,7 @@ class BTreeTests(MappingBase):
def testPathologicalLeftBranching(self): def testPathologicalLeftBranching(self):
t = self._makeOne() t = self._makeOne()
r = range(1000) r = list(range(1000))
revr = list(reversed(r[:])) revr = list(reversed(r[:]))
for x in revr: for x in revr:
t[x] = 1 t[x] = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment