Author: Nikolaos-Digenis Karagiannis <digenish...@gmail.com>
Branch: 
Changeset: r75203:d4b4902dad5e
Date: 2015-01-02 07:22 +0200
http://bitbucket.org/pypy/pypy/changeset/d4b4902dad5e/

Log:    don't capture "func" as a positional argument

diff --git a/lib_pypy/_functools.py b/lib_pypy/_functools.py
--- a/lib_pypy/_functools.py
+++ b/lib_pypy/_functools.py
@@ -9,7 +9,10 @@
     of the given arguments and keywords.
     """
 
-    def __init__(self, func, *args, **keywords):
+    def __init__(self, *args, **keywords):
+        if not args:
+            raise TypeError('__init__() takes at least 2 arguments (1 given)')
+        func, args = args[0], args[1:]
         if not callable(func):
             raise TypeError("the first argument must be callable")
         self._func = func
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to