Skip to content

Commit 631e26a

Browse files
committed
Python std::unordered_set tidy up and additional testing
1 parent 72ccea5 commit 631e26a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Examples/test-suite/python/cpp11_hash_tables_runme.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def swig_assert_equal(a, b):
3434
cpp11_hash_tables.UnorderedMultiMapIntInt({1:7})]:
3535
x[1] = 9
3636
swig_assert_equal(sorted([v for k, v in x.iteritems()]), [7, 9])
37+
swig_assert_equal(len(x), 2)
3738

3839
for x in [cpp11_hash_tables.SetInt([1]),
3940
cpp11_hash_tables.MultiSetInt([1]),
@@ -56,3 +57,4 @@ def swig_assert_equal(a, b):
5657
cpp11_hash_tables.UnorderedMultiSetInt([1])]:
5758
x.append(1)
5859
swig_assert_equal(x.count(1), 2)
60+
swig_assert_equal(len(x), 2)

Lib/python/std_unordered_set.i

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#endif
5050

5151

52-
%extend {
52+
%extend {
5353
void append(value_type x) {
5454
self->insert(x);
5555
}
@@ -61,8 +61,7 @@
6161
value_type __getitem__(difference_type i) const throw (std::out_of_range) {
6262
return *(swig::cgetpos(self, i));
6363
}
64-
65-
};
64+
}
6665
%enddef
6766

6867
%include <std/std_unordered_set.i>

0 commit comments

Comments
 (0)