]> granicus.if.org Git - python/commitdiff
Don't rebind True and False.
authorTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:50:58 +0000 (16:50 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:50:58 +0000 (16:50 +0000)
Lib/test/test_iter.py

index 62a8d02f8d106c6961aefe0e2ba194dff18d6ad7..383fce344a4db8446e6a5a3a885299eb89e254c2 100644 (file)
@@ -329,8 +329,8 @@ class TestCase(unittest.TestCase):
                 self.truth = truth
             def __nonzero__(self):
                 return self.truth
-        True = Boolean(1)
-        False = Boolean(0)
+        bTrue = Boolean(1)
+        bFalse = Boolean(0)
 
         class Seq:
             def __init__(self, *args):
@@ -351,9 +351,9 @@ class TestCase(unittest.TestCase):
                             raise StopIteration
                 return SeqIter(self.vals)
 
-        seq = Seq(*([True, False] * 25))
-        self.assertEqual(filter(lambda x: not x, seq), [False]*25)
-        self.assertEqual(filter(lambda x: not x, iter(seq)), [False]*25)
+        seq = Seq(*([bTrue, bFalse] * 25))
+        self.assertEqual(filter(lambda x: not x, seq), [bFalse]*25)
+        self.assertEqual(filter(lambda x: not x, iter(seq)), [bFalse]*25)
 
     # Test max() and min()'s use of iterators.
     def test_builtin_max_min(self):