[Python-checkins] r53905 - sandbox/trunk/pep362/pep362_fodder.py sandbox/trunk/pep362/test_pep362.py

brett.cannon python-checkins at python.org
Sun Feb 25 17:17:13 CET 2007


Author: brett.cannon
Date: Sun Feb 25 17:17:13 2007
New Revision: 53905

Modified:
   sandbox/trunk/pep362/pep362_fodder.py
   sandbox/trunk/pep362/test_pep362.py
Log:
Be able to pass worst-case function for 2.x.


Modified: sandbox/trunk/pep362/pep362_fodder.py
==============================================================================
--- sandbox/trunk/pep362/pep362_fodder.py	(original)
+++ sandbox/trunk/pep362/pep362_fodder.py	Sun Feb 25 17:17:13 2007
@@ -19,5 +19,5 @@
 def default_tuple_args((a, (b,))=(1, (2,))):
     pass
 
-def all_args(a, (b, (c,)), d=0, (e, (f,))=(1, (2,)), *g, **h):
-    pass
+def all_args(a, (b, (c,)), d=0, (e, (f,))=(4, (5,)), *g, **h):
+    return a, b, c, d, e, f, g, h

Modified: sandbox/trunk/pep362/test_pep362.py
==============================================================================
--- sandbox/trunk/pep362/test_pep362.py	(original)
+++ sandbox/trunk/pep362/test_pep362.py	Sun Feb 25 17:17:13 2007
@@ -273,11 +273,11 @@
         binding = sig.bind(arg)
         self.failUnlessEqual({'a':0, 'b':1}, binding)
 
-    def XXX_test_all_parameter_types(self):
+    def test_all_parameter_types(self):
         sig = pep362.Signature(pep362_fodder.all_args)
-        binding = sig.bind(0, (1, (2,)), 3, (4, (5,)), 6, i=7)
-        expected = {'a':0, ('b', ('c',)):(1, (2,)), 'd':3,
-                ('e', ('f',)):(4, (5,)), 'g':(6,), 'h':{'i':7}}
+        binding = sig.bind(0, (1, (2,)), d=3, i=7)
+        expected = {'a':0, 'b':1, 'c':2, 'd':3, 'e':4, 'f':5, 'g':tuple(),
+                    'h':{'i':7}}
         self.failUnlessEqual(expected, binding)
 
     @py3k_test


More information about the Python-checkins mailing list