[pypy-svn] r22716 - in pypy/dist/pypy/interpreter: . test

ac at codespeak.net ac at codespeak.net
Fri Jan 27 10:33:37 CET 2006


Author: ac
Date: Fri Jan 27 10:33:37 2006
New Revision: 22716

Modified:
   pypy/dist/pypy/interpreter/argument.py
   pypy/dist/pypy/interpreter/test/test_function.py
Log:
Add a test for a bug in argument parsing reported by Seo Sanghyeon,
and fix the bug.



Modified: pypy/dist/pypy/interpreter/argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/argument.py	(original)
+++ pypy/dist/pypy/interpreter/argument.py	Fri Jan 27 10:33:37 2006
@@ -244,8 +244,6 @@
 
     ###  Construction  ###
 
-    blind_arguments = 0
-
     def __init__(self, space, args_w=None, kwds_w=None,
                  w_stararg=None, w_starstararg=None):
         self.space = space
@@ -403,11 +401,11 @@
             input_argcount = len(args_w) + blindargs
 
         # check that no keyword argument conflicts with these
-        # note that for this purpose we ignore the first blind_arguments,
+        # note that for this purpose we ignore the first blindargs,
         # which were put into place by prepend().  This way, keywords do
         # not conflict with the hidden extra argument bound by methods.
-        if kwds_w and input_argcount > self.blind_arguments:
-            for name in argnames[self.blind_arguments:input_argcount]:
+        if kwds_w and input_argcount > blindargs:
+            for name in argnames[blindargs:input_argcount]:
                 if name in kwds_w:
                     raise ArgErrMultipleValues(name)
 

Modified: pypy/dist/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_function.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_function.py	Fri Jan 27 10:33:37 2006
@@ -217,7 +217,14 @@
             def f(self):
                 pass
         assert repr(B.f) == "<unbound method B.f>"
-        assert repr(B().f).startswith("<bound method B.f of <") 
+        assert repr(B().f).startswith("<bound method B.f of <")
+
+
+    def test_method_call(self):
+        class C:
+            def __init__(self, **kw):
+                pass
+        c = C(type='test')
 
 class TestMethod: 
     def setup_method(self, method):



More information about the Pypy-commit mailing list