// Silly example: get the length of a string, supporting Unicode and byte strings static PyObject* getlen_py(PyObject *self, PyObject *args) { // Unpack our argument (error handling omitted...) PyObject *arg = NULL; PyArg_UnpackTuple(args, "getlen", 1, 1, arg) ; ...