PyArg_ParseTupleAndKeywords

Mr.M mrm at unknown.nospam
Sat Jan 23 13:21:25 EST 2010


MRAB ha scritto:

> Did you specify that the method accepts keywords arguments with
> METH_KEYWORDS? The function would take parameters for the instance
> (self), the positional arguments (args) and the keyword arguments
> (kwargs).
> 
> http://docs.python.org/c-api/structures.html
> 
> If you don't use METH_KEYWORDS then it'll think that all the arguments
> are positional, which is what seems to be happening:
> 

Thank you MRAB for your reply.
No, i didn't specify METH_KEYWORDS flag, but i think init method (the 
one that you put in tp_init slot, it is "initproc" type) doesn't have to 
appear in the PyMethodDef structure.

Maybe i'm wrong?

Luca.



More information about the Python-list mailing list