summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2003-02-10 17:36:40 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2003-02-10 17:36:40 (GMT)
commit8dd19321bbb3b4f94d15ca3a405053265b99e91e (patch)
tree8fd34769278798e5b54dfe4f9248cef56f2e3977 /Lib
parent8d326b8581e8246d006bd4c5ab1d9f30972ef5cb (diff)
downloadcpython-8dd19321bbb3b4f94d15ca3a405053265b99e91e.zip
cpython-8dd19321bbb3b4f94d15ca3a405053265b99e91e.tar.gz
cpython-8dd19321bbb3b4f94d15ca3a405053265b99e91e.tar.bz2
Change filtertuple() to use tp_as_sequence->sq_item
instead of PyTuple_GetItem, so an overwritten __getitem__ in a tuple subclass works. SF bug #665835.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_builtin.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 9af3233..f52d9c6 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -419,7 +419,6 @@ class BuiltinTest(unittest.TestCase):
def test_filter_subclasses(self):
# test, that filter() never returns tuple, str or unicode subclasses
# and that the result always go's through __getitem__
- # FIXME: For tuple currently it doesn't go through __getitem__
funcs = (None, lambda x: True)
class tuple2(tuple):
def __getitem__(self, index):
@@ -428,7 +427,7 @@ class BuiltinTest(unittest.TestCase):
def __getitem__(self, index):
return 2*str.__getitem__(self, index)
inputs = {
- tuple2: {(): (), (1, 2, 3): (1, 2, 3)}, # FIXME
+ tuple2: {(): (), (1, 2, 3): (2, 4, 6)},
str2: {"": "", "123": "112233"}
}
if have_unicode: