Fixes when using python -builtin and STL container wrappers.
Deletion of single elements previously failed. Test case li_std_containers_int now works.
This commit is contained in:
parent
49038b30b7
commit
a89a892843
2 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.3 (in progress)
|
Version 3.0.3 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2014-10-06: wsfulton
|
||||||
|
[Python] Fixes when using -builtin and std::vector/std::list wrappers to allow deletion
|
||||||
|
of single elements, such as 'del vec[0]'.
|
||||||
|
|
||||||
2014-09-30: wsfulton
|
2014-09-30: wsfulton
|
||||||
[Python] Patch #207 - Fix No module error with -relativeimport when using single
|
[Python] Patch #207 - Fix No module error with -relativeimport when using single
|
||||||
header file import.
|
header file import.
|
||||||
|
|
|
||||||
|
|
@ -874,6 +874,13 @@ namespace swig
|
||||||
*(swig::getpos(self,i)) = x;
|
*(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) {
|
void append(const value_type& x) {
|
||||||
self->push_back(x);
|
self->push_back(x);
|
||||||
}
|
}
|
||||||
|
|
@ -892,6 +899,13 @@ namespace swig
|
||||||
*(swig::getpos(self,i)) = x;
|
*(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) {
|
void append(value_type x) {
|
||||||
self->push_back(x);
|
self->push_back(x);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue