diff --git a/CHANGES.current b/CHANGES.current index eb109a6b0..651df4e2e 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release. Version 2.0.8 (in progress) =========================== +2012-08-15: wsfulton + [Python] Add discard and add methods to std::set wrappers so that pyabc.i can be used ensuring + MutableSet is a valid abstract base class for std::set. As reported by Alexey Sokolov. + Similarly for std::multiset. + 2012-08-15: wsfulton [Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3. diff --git a/Examples/test-suite/python/python_abstractbase_runme3.py b/Examples/test-suite/python/python_abstractbase_runme3.py index b7593f109..94dee3ff7 100644 --- a/Examples/test-suite/python/python_abstractbase_runme3.py +++ b/Examples/test-suite/python/python_abstractbase_runme3.py @@ -10,3 +10,11 @@ assert issubclass(IntSet, MutableSet) assert issubclass(IntMultiset, MutableSet) assert issubclass(IntVector, MutableSequence) assert issubclass(IntList, MutableSequence) + +mapii = Mapii() +multimapii = Multimapii() +intset = IntSet() +intmultiset = IntMultiset() +intvector = IntVector() +intlist = IntList() + diff --git a/Lib/python/std_set.i b/Lib/python/std_set.i index 59f69cdc9..53f97e475 100644 --- a/Lib/python/std_set.i +++ b/Lib/python/std_set.i @@ -49,6 +49,14 @@ return *(swig::cgetpos(self, i)); } + void add(value_type x) { + self->insert(x); + } + + void discard(value_type x) { + self->erase(x); + } + }; %enddef