add set __getitem__ method, this allows python iterator syntax to work, as in 'for i in a_set:...'

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7338 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-07-19 09:36:08 +00:00
commit 877535badf
2 changed files with 14 additions and 0 deletions

View file

@ -91,4 +91,14 @@ v3 = std_containers.vector_piA(v2)
v3[0][1].a
v3[1][1].a
s = std_containers.set_i()
s.append(1)
s.append(2)
s.append(3)
j=1
for i in s:
if i != j:
raise RuntimeError
j = j + 1