[Python-checkins] python/dist/src/Lib/test test_builtin.py,1.12,1.13

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Mon, 10 Feb 2003 09:36:42 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv28462/Lib/test

Modified Files:
	test_builtin.py 
Log Message:
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.


Index: test_builtin.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_builtin.py	10 Feb 2003 13:19:13 -0000	1.12
--- test_builtin.py	10 Feb 2003 17:36:40 -0000	1.13
***************
*** 420,424 ****
          # 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):
--- 420,423 ----
***************
*** 429,433 ****
                  return 2*str.__getitem__(self, index)
          inputs = {
!             tuple2: {(): (), (1, 2, 3): (1, 2, 3)}, # FIXME
              str2:   {"": "", "123": "112233"}
          }
--- 428,432 ----
                  return 2*str.__getitem__(self, index)
          inputs = {
!             tuple2: {(): (), (1, 2, 3): (2, 4, 6)},
              str2:   {"": "", "123": "112233"}
          }