Add more tests for Python parameter renaming
These tests were proposed by @wsfulton. See https://github.com/swig/swig/issues/1272
This commit is contained in:
parent
3f5c17824c
commit
22158807fa
3 changed files with 12 additions and 0 deletions
|
|
@ -148,3 +148,11 @@ bool is_python_builtin() { return true; }
|
||||||
bool is_python_builtin() { return false; }
|
bool is_python_builtin() { return false; }
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// Autodoc Python keywords
|
||||||
|
%warnfilter(SWIGWARN_PARSE_KEYWORD) process;
|
||||||
|
%feature(autodoc,0) process;
|
||||||
|
%feature("compactdefaultargs") process;
|
||||||
|
%inline %{
|
||||||
|
int process(int from) { return from; }
|
||||||
|
%}
|
||||||
|
|
|
||||||
|
|
@ -202,3 +202,5 @@ check(inspect.getdoc(banana), "banana(S a, S b, int c, Integer d)")
|
||||||
check(inspect.getdoc(TInteger), "Proxy of C++ T< int > class.", "::T< int >")
|
check(inspect.getdoc(TInteger), "Proxy of C++ T< int > class.", "::T< int >")
|
||||||
check(inspect.getdoc(TInteger.__init__), "__init__(TInteger self) -> TInteger", None, skip)
|
check(inspect.getdoc(TInteger.__init__), "__init__(TInteger self) -> TInteger", None, skip)
|
||||||
check(inspect.getdoc(TInteger.inout), "inout(TInteger self, TInteger t) -> TInteger")
|
check(inspect.getdoc(TInteger.inout), "inout(TInteger self, TInteger t) -> TInteger")
|
||||||
|
|
||||||
|
check(inspect.getdoc(process), "process(_from) -> int")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import keyword_rename
|
import keyword_rename
|
||||||
keyword_rename._in(1)
|
keyword_rename._in(1)
|
||||||
|
keyword_rename._in(_except=1)
|
||||||
keyword_rename._except(1)
|
keyword_rename._except(1)
|
||||||
|
keyword_rename._except(_in=1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue