21 Nov
2012
21 Nov
'12
10:35 a.m.
nirmoy das, 21.11.2012 12:38:
Can anyone tell me how to use expression in PyObject_CallObject() as argument of object
ex:column_family('keyspace', 'CF', comparator_type=comparator)
My (biased) advice is to use Cython. It allows you to call functions in plain and simple Python syntax, including keyword arguments and the like. So your example above completely solves your problem already.
If you want to do it manually, and assuming that with "expression" you mean "keyword arguments", as in your example above, you have to first build a dict with PyDict_New(), then add a new value to it, then pass the dict into the call, and then decref the reference to the dict.
Stefan