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:
parent
986a13f1a0
commit
b8e1a66a38
5 changed files with 153 additions and 3 deletions
|
|
@ -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; }
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue