I find the generated Python wrapper for a C++ function by swig has the following lines:
def my_func(arg):
return _cpp_mod.my_cpp_func(arg)
my_func = _cpp_mod.my_cpp_func
The source code in the .i file is as follows:
%module cpp_mod
... ...
%inline %{
MyObj& my_cpp_func(arg) {
return *new MyObj(arg);
}
%}
All functions of the generated code seem OK.
What I want to know is the purpose of the third line for the
generated python code. Thanks in advance.