summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-10-06 10:56:04 +1300
committerOlly Betts <olly@survex.com>2022-10-06 12:57:48 +1300
commit6f3f4fbdf163cef537960620e48190f36ad2c08b (patch)
treeaf65672196e6a4b180da5d5f7211e484cff176d8 /Lib
parentbc87fe151e10ca392aa268c92b593d567b254762 (diff)
downloadswig-6f3f4fbdf163cef537960620e48190f36ad2c08b.tar.gz
[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
Diffstat (limited to 'Lib')
-rw-r--r--Lib/python/README1
-rw-r--r--Lib/python/defarg.swg37
2 files changed, 0 insertions, 38 deletions
diff --git a/Lib/python/README b/Lib/python/README
index fa8ef61e7..70968e7dd 100644
--- a/Lib/python/README
+++ b/Lib/python/README
@@ -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
diff --git a/Lib/python/defarg.swg b/Lib/python/defarg.swg
deleted file mode 100644
index ba5ff43d4..000000000
--- a/Lib/python/defarg.swg
+++ /dev/null
@@ -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);
-}