What I currently want to accomplish is to tweak Pythons itertools module function combinations to sort the passed iterable before creatin
You should get the sorted function out of the builtins and than call it:
PyObject *builtins = PyEval_GetBuiltins();
PyObject *sorted = PyDict_GetItemString(builtins , "sorted");
PyObject *sorted_list = PyEval_CallFunction(sorted, "(O)", iterable);
//... do something with the sorted_list
Py_DECREF(sorted_list);