Added support for multiple inheritance. Not as hard as I feared.

Apply operator features to both the operator name, and the renamed
"__*__" method.  That's the only way to hit all corners.

Added support for %pythonnondynamic.  I believe this implementation
is more correct than the existing implementation, but I'm still
waiting for an adjudication on the behavior of the python_nondynamic
test.

Current list of unsupported features that require minor tweaks
to the test suite:

- 'this' member variable is obsolete.

- No support for reversible operator overloads (e.g., __radd__).  You
can still support this:

a = MyString("foo")
b = "bar"
c = a + b

... but you can't do this:

a = "foo"
b = MyString("bar")
c = a + b

With the tweaks, the test suite now fails on python_nondynamic.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12353 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Stefan Zager 2010-12-20 23:35:18 +00:00
commit 3a86f2068f
5 changed files with 182 additions and 55 deletions

View file

@ -7,6 +7,8 @@
%init %{
#ifdef __cplusplus
#include <vector>
extern "C" {
#endif
@ -338,7 +340,11 @@ SWIG_init(void) {
#if defined(SWIGPYTHON_BUILTIN)
PyTypeObject *builtin_pytype = 0;
PyObject *propargs = NULL, *propget = NULL, *propset = NULL, *propobj = NULL;
std::vector<PyTypeObject*> builtin_bases;
swig_type_info *builtin_basetype = 0;
PyObject *base_tuple = NULL;
int i;
SWIG_Python_builtin_imports();
#endif