Here is a mail I've sent a few days ago to Stefan...
---------- Forwarded message ----------
From: Lisandro Dalcin <[email protected]>
Date: Wed, Dec 2, 2009 at 11:40 PM
Subject: classmethod-related changes for cls argument
To: Stefan Behnel <[email protected]>
Stefan, I'm very busy with personal stuff, so no time at all to look
on this. You have below the output from an interactive IPython
session. Perhaps you forgot to update some code counting function
arguments (I bet such code was discounting self_arg, but you should
also discount type_arg?)
In [1]: from mpi4py import MPI
In [2]: MPI.Comm.Compare?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in method Compare of type object at 0x2b6b038e0e20>
Namespace: Interactive
Docstring:
Comm.Compare(type cls, Comm comm1, Comm comm2)
Compare two communicators
In [3]: MPI.Comm.Compare(MPI.COMM_WORLD, MPI.COMM_WORLD)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/u/dalcinl/Devel/mpi4py-dev/<ipython console> in <module>()
/u/dalcinl/lib64/python/mpi4py/MPI.so in mpi4py.MPI.Comm.Compare
(src/mpi4py.MPI.c:46815)()
TypeError: Compare() takes at least 3 positional arguments (2 given)
In [4]:
The patch below fixes my issues, but I not sure if this is the
definitive solution ...
diff -r f6efe60d7a31 Cython/Compiler/Nodes.py
--- a/Cython/Compiler/Nodes.py Fri Dec 04 15:23:23 2009 +0100
+++ b/Cython/Compiler/Nodes.py Fri Dec 04 21:25:33 2009 -0300
@@ -2075,7 +2075,7 @@
argtuple_error_label = code.new_label("argtuple_error")
min_positional_args = self.num_required_args -
self.num_required_kw_args
- if len(self.args) > 0 and self.args[0].is_self_arg:
+ if len(self.args) > 0 and (self.args[0].is_self_arg or
self.args[0].is_type_arg):
min_positional_args -= 1
max_positional_args = len(positional_args)
has_fixed_positional_count = not self.star_arg and \
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev