I am using the Eric IDE for Python. It is using autocompletion and it should be very useful.
But, we develop python scripts that use objects from a C++ library that we convert using Swig. Unfortunately, swig create a .py file that maps each C++ object's method replacing all arguments with an *args unique argument and so Eric's autocompletion is not as useful as it may be as it does not display the list of parameters but only that args which is useless.
For instance, I have a C++ .h file :
#ifdef SWIG
%module testPy
%{
#include "testPy.h"
%}
%feature("autodoc","0");
#endif //SWIG
class IntRange
{
public:
bool contains(int value) const;
};
I generate the .py file by :
swig3.0 -c++ -python testPy.h
and the generated .py file contains :
def contains(self, *args):
"""contains(self, value) -> bool"""
return _testPy.IntRange_contains(self, *args)
So the autodoc part is fine. Unfortunately, it is not used by Eric and the arguments of the method have been replaced by *args.
Is there a way to ask swig to keep the arguments' names?
N.B : I am using Python 2.7 and swig 3.0.2