mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Don't rebind True and False.
This commit is contained in:
parent
9c8a0866c9
commit
cae330e449
1 changed files with 5 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue