次のような関数定義があります。
void Foo(int szData,int Data[]);
そして私は次のようなSWIGタイプマップを持っています:
%typemap(in) (int szData,int Data[])
{
  int i; 
  if (!PyTuple_Check($input))
  {
      PyErr_SetString(PyExc_TypeError,"Expecting a tuple for this parameter");
      $1 = 0;
  }
  else
    $1 = PyTuple_Size($input);
  $2 = (int *) malloc(($1+1)*sizeof(int));
  for (i =0; i < $1; i++)
  {
      PyObject *o = PyTuple_GetItem($input,i);
      if (!PyInt_Check(o))
      {
         free ($2);
         PyErr_SetString(PyExc_ValueError,"Expecting a tuple of integers");
         return NULL;
      }
      $2[i] = PyInt_AsLong(o);
  }
  $2[i] = 0;
}
typemap を使用すると、Python から次のように Foo() を呼び出すことができます: Foo((1,2,3))
次のようなオーバーロードされた関数を追加するまで、これは完全にうまく機能します。
すべてが正常にビルドされますが、Python から Foo() を呼び出すと、次のようになります。
NotImplementedError: Wrong number or type of arguments for overloaded function 'Foo'.
  Possible C/C++ prototypes are:
    Foo(int,int [])
    Foo(double)
typemap(in) を削除すると、問題なく動作します。
私は完全に困惑しているので、誰かが何かアイデアを持っていれば感謝します...