mirror of https://github.com/swig/swig
[Python] Remove deprecated and apparently useless defarg.swg
The only documentation is in the file itself and describes a Python wrapper around the C function defined here, but digging though the git history this Python wrapper doesn't seem to have ever actually been generated by SWIG. This file was also marked as deprecated in 2005. Fixes #2390 Fixes #2391
This commit is contained in:
parent
bc87fe151e
commit
6f3f4fbdf1
|
@ -7,6 +7,16 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
|||
Version 4.1.0 (in progress)
|
||||
===========================
|
||||
|
||||
2022-10-06: olly
|
||||
[Python] #2390 Remove deprecated and apparently useless defarg.swg
|
||||
|
||||
The only documentation is in the file itself and describes a Python
|
||||
wrapper around the C function defined here, but digging though the
|
||||
git history this Python wrapper doesn't seem to have ever actually
|
||||
been generated by SWIG.
|
||||
|
||||
This file was also marked as deprecated in 2005.
|
||||
|
||||
2022-10-06: wsfulton
|
||||
[Java] #2048 Fix quoting for doxygen \image command to quote the output
|
||||
file name generated into the html src attribute.
|
||||
|
@ -14,7 +24,6 @@ Version 4.1.0 (in progress)
|
|||
2022-10-05: benjamin-sch
|
||||
[Python] added an interpreter counter to fix deinitialization
|
||||
issues if multiple subinterpreters are used
|
||||
|
||||
2022-10-05: olly, wsfulton
|
||||
#672 Add support for parsing C++11 final classes such as:
|
||||
|
||||
|
|
|
@ -101,4 +101,3 @@ std_container.i general common code for the STD/STL containers
|
|||
|
||||
std_vectora.i vector + allocator (allocators are now supported in STD/STL)
|
||||
typemaps.i old in/out typemaps (doesn't need to be included)
|
||||
defarg.swg for processing default arguments with shadow classes
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/* This file defines an internal function for processing default arguments
|
||||
with proxy classes.
|
||||
|
||||
There seems to be no straightforward way to write proxy functions
|
||||
involving default arguments. For example :
|
||||
|
||||
def foo(arg1,arg2,*args):
|
||||
proxyc.foo(arg1,arg2,args)
|
||||
|
||||
This fails because args is now a tuple and SWIG doesn't know what to
|
||||
do with it.
|
||||
|
||||
This file allows a different approach :
|
||||
|
||||
def foo(arg1,arg2,*args):
|
||||
proxyc.__call_defarg(proxyc.foo,(arg1,arg2,)+args)
|
||||
|
||||
Basically, we form a new tuple from the object, call this special
|
||||
__call_defarg method and it passes control to the real wrapper function.
|
||||
An ugly hack, but it works.
|
||||
*/
|
||||
|
||||
SWIGINTERN PyObject *swig_call_defargs(PyObject *self, PyObject *args) {
|
||||
PyObject *func;
|
||||
PyObject *parms;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO", &func, &parms))
|
||||
return NULL;
|
||||
|
||||
if (!PyCallable_Check(func)) {
|
||||
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||
PyErr_SetString(PyExc_TypeError, "__call_defarg : Need a callable object!");
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return NULL;
|
||||
}
|
||||
return PyObject_Call(func, parms, NULL);
|
||||
}
|
Loading…
Reference in New Issue