From: Marco C. <mv...@di...> - 2008-01-02 00:18:24
|
hi, If I have a class struct B { B(int); B(float); B(char*); } and a function void bla(B); then, in C++, I can call bla(4) bla(3.8) But when I use the swig'd python version of this, then I have to explicitely say: bla(B(4)) bla(B(3.8)) How do I turn on the implicit conversions? Or is it not possible? I tried to use a typemap for this: $typemap(in) B { if PyIntCheck($1) then return B(PyInt($input)) ... } but I'm not sure this is the way to go... Can anyone clarify me on this ? Thanks! -- Marco Correia <mv...@di...> |