No changes, just added an explanatory comment to Python module.
Explain a bit better when and why do we decide to use "*args" in the generated Python code.
This commit is contained in:
parent
0eae8a8efa
commit
2369e2c500
1 changed files with 9 additions and 1 deletions
|
|
@ -2068,7 +2068,15 @@ public:
|
|||
if (nn)
|
||||
n = nn;
|
||||
|
||||
/* For overloaded function, just use *args */
|
||||
/* We prefer to explicitly list all parameters of the C function in the
|
||||
generated Python code as this makes the function more convenient to use,
|
||||
however in some cases we must replace the real parameters list with just
|
||||
the catch all "*args". This happens when:
|
||||
|
||||
1. The function is overloaded as Python doesn't support this.
|
||||
2. We were explicitly asked to use the "compact" arguments form.
|
||||
3. One of the default argument values can't be represented in Python.
|
||||
*/
|
||||
if (is_real_overloaded(n) || GetFlag(n, "feature:compactdefaultargs") || !is_representable_as_pyargs(n)) {
|
||||
String *parms = NewString("");
|
||||
if (in_class)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue