diff options
Diffstat (limited to 'Lib/python/pycontainer.swg')
-rw-r--r-- | Lib/python/pycontainer.swg | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg index dcada87c7..e5543cd6b 100644 --- a/Lib/python/pycontainer.swg +++ b/Lib/python/pycontainer.swg @@ -710,7 +710,8 @@ namespace swig #if defined(SWIGPYTHON_BUILTIN) %feature("python:slot", "tp_iter", functype="getiterfunc") iterator; #else - %pythoncode {def __iter__(self): return self.iterator()} + %pythoncode {def __iter__(self): + return self.iterator()} #endif } @@ -873,6 +874,13 @@ namespace swig *(swig::getpos(self,i)) = x; } +#if defined(SWIGPYTHON_BUILTIN) + // This will be called through the mp_ass_subscript slot to delete an entry. + void __setitem__(difference_type i) throw (std::out_of_range) { + self->erase(swig::getpos(self,i)); + } +#endif + void append(const value_type& x) { self->push_back(x); } @@ -891,6 +899,13 @@ namespace swig *(swig::getpos(self,i)) = x; } +#if defined(SWIGPYTHON_BUILTIN) + // This will be called through the mp_ass_subscript slot to delete an entry. + void __setitem__(difference_type i) throw (std::out_of_range) { + self->erase(swig::getpos(self,i)); + } +#endif + void append(value_type x) { self->push_back(x); } |