From 2369e2c500ee19d492954bc04ac76d1a17db1e2d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 22 Apr 2015 20:37:20 +0200 Subject: [PATCH] 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. --- Source/Modules/python.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 17ffbbd67..5ae4b6d55 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -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)