[Python-3000-checkins] r53739 - python/branches/p3yk/Lib/test/test_builtin.py

guido.van.rossum python-3000-checkins at python.org
Sun Feb 11 19:53:00 CET 2007


Author: guido.van.rossum
Date: Sun Feb 11 19:53:00 2007
New Revision: 53739

Modified:
   python/branches/p3yk/Lib/test/test_builtin.py
Log:
Another fix.  Partly reverted the tweaks done by the previous fix.


Modified: python/branches/p3yk/Lib/test/test_builtin.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_builtin.py	(original)
+++ python/branches/p3yk/Lib/test/test_builtin.py	Sun Feb 11 19:53:00 2007
@@ -290,8 +290,8 @@
                 if key == 'a':
                     return 12
                 raise KeyError
-            def __iter__(self):
-                return iter('xyz')
+            def keys(self):
+                return list('xyz')
 
         m = M()
         g = globals()
@@ -313,8 +313,8 @@
                 if key == 'a':
                     return 12
                 return dict.__getitem__(self, key)
-            def __iter__(self):
-                return iter('xyz')
+            def keys(self):
+                return list('xyz')
 
         d = D()
         self.assertEqual(eval('a', g, d), 12)
@@ -346,8 +346,8 @@
         class C:
             def __getitem__(self, item):
                 raise KeyError(item)
-            def __iter__(self):
-                return 'a'  # XXX Not quite faithful to the SF bug...
+            def keys(self):
+                return 1 # used to be 'a' but that's no longer an error
         self.assertRaises(TypeError, eval, 'dir()', globals(), C())
 
     # Done outside of the method test_z to get the correct scope


More information about the Python-3000-checkins mailing list