[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:
Olly Betts 2022-10-06 10:56:04 +13:00
commit 6f3f4fbdf1
3 changed files with 10 additions and 39 deletions

View file

@ -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

View file

@ -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);
}