Regressions pass! With a few tweaks for unsupported features, primarily:

- Throwing wrapped types as exceptions is unsupported.
- Reverse comparison operators (e.g., __radd__) aren't supported.

Rationalized destructors.

Finished std::map implementation.  Required fixes to typecheck for
SWIGTYPE* const&.

Need a little special handling of the swig_type_info for SwigPyObject
when multiple modules are loaded.

Fall back to SwigPyObject_richcompare if there's no operator overload.

"memberget" and "memberset" attrs are applied strangely; work around
them.

Added 'this' attribute.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12415 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Stefan Zager 2011-01-30 03:17:28 +00:00
commit 288c37f5bf
9 changed files with 352 additions and 574 deletions

View file

@ -128,6 +128,13 @@ namespace swig {
return desc;
}
};
inline PyObject* make_output_iterator_builtin (PyObject *pyself)
{
Py_INCREF(pyself);
return pyself;
}
}
}
@ -304,7 +311,7 @@ namespace swig {
}
template <typename Sequence>
inline PyObject* make_output_iterator_builtin (PyObject *pyself)
inline PyObject* make_output_iterator_builtin_T (PyObject *pyself)
{
SwigPyObject *builtin_obj = (SwigPyObject*) pyself;
Sequence *seq = reinterpret_cast< Sequence * >(builtin_obj->ptr);
@ -314,12 +321,6 @@ namespace swig {
return SWIG_NewPointerObj(iter, SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN);
}
template <>
inline PyObject* make_output_iterator_builtin<SwigPyIterator> (PyObject *pyself)
{
Py_INCREF(pyself);
return pyself;
}
}
}
@ -349,7 +350,7 @@ namespace swig
%nodirector SwigPyIterator;
#if defined(SWIGPYTHON_BUILTIN)
%feature("tp_iter") SwigPyIterator "&swig::make_output_iterator_builtin<swig::SwigPyIterator>";
%feature("tp_iter") SwigPyIterator "&swig::make_output_iterator_builtin";
%feature("pyslot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__;
#else
%extend SwigPyIterator {