Add new feature "python:cdefaultargs"

Controls default argument code generation to obtain the default
arguments from the C++ layer instead of the Python layer.
This commit is contained in:
William S Fulton 2015-05-28 20:11:57 +01:00
commit b8e1a66a38
5 changed files with 153 additions and 3 deletions

View file

@ -292,3 +292,12 @@ struct ConstMethods {
inline int slightly_off_square(int square_error, int def17) { return def17*def17 + square_error; }
%}
// Python C default args
%feature("python:cdefaultargs") CDA::cdefaultargs_test1;
%inline %{
struct CDA {
int cdefaultargs_test1(int a = 1) { return a; }
int cdefaultargs_test2(int a = 1) { return a; }
};
%}