Thanks for your reply. yes, I pass a list as an argument to the function in C. The list has a random length. Do you mean to do it in this way? use PyTuple_Size(args), in a loop use PyTuple_GetItem(args, i) or use PyArg_VaParse? Best Regards