Make a copy of L before appending, so the global L remains
unchanged (and sys.gettotalrefcount() remains constant). Fix a few typos.
This commit is contained in:
parent
150523efa5
commit
c8cb5d9d69
|
@ -364,9 +364,9 @@ class BuiltinTest(unittest.TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_filter_subclasses(self):
|
def test_filter_subclasses(self):
|
||||||
# test, that filter() never returns tuple, str or unicode subclasses
|
# test that filter() never returns tuple, str or unicode subclasses
|
||||||
# and that the result always go's through __getitem__
|
# and that the result always goes through __getitem__
|
||||||
funcs = (None, lambda x: True)
|
funcs = (None, bool, lambda x: True)
|
||||||
class tuple2(tuple):
|
class tuple2(tuple):
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
return 2*tuple.__getitem__(self, index)
|
return 2*tuple.__getitem__(self, index)
|
||||||
|
@ -630,7 +630,7 @@ class BuiltinTest(unittest.TestCase):
|
||||||
('1' + '0'*20, 10L**20),
|
('1' + '0'*20, 10L**20),
|
||||||
('1' + '0'*100, 10L**100)
|
('1' + '0'*100, 10L**100)
|
||||||
]
|
]
|
||||||
L2 = L
|
L2 = L[:]
|
||||||
if have_unicode:
|
if have_unicode:
|
||||||
L2 += [
|
L2 += [
|
||||||
(unicode('1') + unicode('0')*20, 10L**20),
|
(unicode('1') + unicode('0')*20, 10L**20),
|
||||||
|
|
Loading…
Reference in New Issue