[PyQt] SIP support for keyword arguments in __call__ ?

Ravi kumar ravi.kumar.039 at gmail.com
Tue Mar 9 02:02:25 GMT 2010


Hello

I have added some support for keyword arguments in __call__ methods
of classes.

As I was told, to preserve compatibility, I havent modified
slot_call() in siplib/siplib.c. Instead I have added another
slot type :

call_slot_kw (in siplib/sip.h)

and added a function slot_call_kw (in siplib/siplib.c)

I have also done some changes in sipgen code so __call__ now
listens to NoArgParser and KeywordArgs annotations.

The full diff can be downloaded from :

http://www.4shared.com/file/237227242/92020b6f/sipkwcall_snapshot-4101-637497.html
(It will ask for 10 second wait :S, any better way to send file ?)

The above diff is for this version of SIP : sip-snapshot-4.10.1-637497440cb5

I was able to successfuly compile the latest version of pyqt available :
PyQt-x11-gpl-snapshot-4.7.1-6633161a35bf

I have only tested it currently on my own system only :
Python : Stackless (v3.1)
OS     : x86_64 linux (Ubuntu Karmic Koala)

I will soon test it on i386 linux and windows too, and will post about it.

One particular question I want to ask is that the function slotName()
in sipgen/gencode.c only takes the slot type as argument to determine
the sip module's string equivalent, whereas in my case, other
details from methodDef is also needed. So for now i have added an
'if' at line 8983 in gencode.c, but I dont think this is a good way.

Any suggestions ?


More information about the PyQt mailing list