
Nov. 22, 2012
7:23 p.m.
"M.-A. Lemburg" <mal@egenix.com> writes:
kwds = Py_BuildValue("sO", "comparator_type", comparator");
Small typo:
kwds = Py_BuildValue("{sO}", "comparator_type", comparator);
The braces tell Py_BuildValue to create a dict.
Yup, sorry about that.
For better readability, it also good to add the parens to the args format string:
args = Py_BuildValue("(ss)", "keyspace", "CF");
I concur. Likewise, dict can be expressed as "{s:O}", which reminds of the dict building syntax in Python.