why does SWIG make illegal wrapper from in and argout typemaps?
问题 I am trying to write an argout SWIG typemap. From this interface foobar.i file, which seems perfectly legal to me: %{ void f(int arg[2]) {} %} %typemap(in, numinputs = 0) int [ANY] {} %typemap(argout) int arg[ANY] { PySequence_SetItem($input, 0, PyInt_FromLong(0)); } void f(int arg[2]) {} SWIG compiles an illegal foobar_wrap.cxx file, because it contains the following fragment: PySequence_SetItem(, 0, PyInt_FromLong(0)); replacing $input with nothing. If I omit the in typemap, then the