Stefan Behnel wrote:

>>    cdef class cclass:
>>         def test(*args):
>>             pass
 >
> Pyrex suffers from the same problem:
> 
> $ python ./bin/pyrexc cdef_methods_T462.pyx
> [...]
> .../cdef_methods_T462.pyx:26:4: Method test_args has wrong number of
> arguments (0 declared, 1 or more expected)

I've just been looking into this. The problem is that at the C
level, "self" is passed into methods as a separate argument, so
that you need to declare the method as

          def test(self, *args):
             ...

I'm inclined to not bother trying to fix this in Pyrex, because
it would take extra effort to merge "self" into the *args, and
it seems like a rather rare thing to want to do.

-- 
Greg

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to