summaryrefslogtreecommitdiff
path: root/Lib/python/std_map.i
diff options
context:
space:
mode:
authorStefan Zager <szager@gmail.com>2011-01-30 03:17:28 +0000
committerStefan Zager <szager@gmail.com>2011-01-30 03:17:28 +0000
commit288c37f5bf17df431dbdaa23f4a0c41229a9868f (patch)
tree1fb108350743b16c1d75daa872adfd0e3fbc05b6 /Lib/python/std_map.i
parentd4b8048e9ac7556dd78142afb8b508ca3585ca4f (diff)
downloadswig-288c37f5bf17df431dbdaa23f4a0c41229a9868f.tar.gz
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
Diffstat (limited to 'Lib/python/std_map.i')
-rw-r--r--Lib/python/std_map.i7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i
index 8f06a97d9..8dcb90fe5 100644
--- a/Lib/python/std_map.i
+++ b/Lib/python/std_map.i
@@ -158,7 +158,7 @@
#if defined(SWIGPYTHON_BUILTIN)
%feature("pyslot", "mp_length", functype="lenfunc") __len__;
%feature("pyslot", "mp_subscript", functype="binaryfunc") __getitem__;
- %feature("tp_iter") Map "&swig::make_output_key_iterator_builtin< Map >";
+ %feature("pyslot", "tp_iter", functype="getiterfunc") key_iterator;
%extend {
%newobject iterkeys(PyObject **PYTHON_SELF);
@@ -288,20 +288,21 @@
#if defined(SWIGPYTHON_BUILTIN)
%feature("pyslot", "mp_ass_subscript", functype="objobjargproc") __setitem__;
+#endif
%extend {
// This will be called through the mp_ass_subscript slot to delete an entry.
void __setitem__(const key_type& key) {
self->erase(key);
}
- }
-#endif
+ }
%extend {
void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) {
(*self)[key] = x;
}
}
+
%enddef