It depends on whether your function has already been written and cannot be changed, in which case you may need to check your Swig docs to see if there is already a typical map from PyList to std :: vector (I think it is) . If not, using PyObject * as a function argument and using the Python C API to manage lists should work fine. So far I have not had any problems. For do-it-yourself documentation, I recommend typedef'ing PyObject * for some expected type, like "PythonList", so that the parameters make some sense.
It may also be useful:
How to set std :: vector <int> as a Python list using SWIG?
source share