Hello. I declare in C ++ class, well, for example:

сlass Point { public: Point(int color, int x=0, int y=0); }; 

Now from Pyhton I try to create an object

 p = Point(16, y=0) 

But I get something like:

 TypeError: __init__() got an unexpected keyword argument 'y' 

How to generate a interface with named arguments for Pyhton using SWIG?

    1 answer 1

    Add the following line to your interface file, for example point.i:

     %feature ("kwargs") Point;