map iterators now use the native PySwigIterator, which is very very good for large maps, since no more temporals key/value tuples are needed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8311 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bed09b373e
commit
2bde7c2c3b
3 changed files with 134 additions and 57 deletions
|
|
@ -17,6 +17,13 @@ dmap = example.DoubleMap()
|
|||
dmap["hello"] = 1.0
|
||||
dmap["hi"] = 2.0
|
||||
|
||||
for i in dmap.iterkeys():
|
||||
print "key", i
|
||||
|
||||
for i in dmap.itervalues():
|
||||
print "val", i
|
||||
|
||||
|
||||
print dmap.items()
|
||||
print dmap.keys()
|
||||
print dmap.values()
|
||||
|
|
@ -26,6 +33,7 @@ print hmap.keys()
|
|||
print hmap.values()
|
||||
|
||||
|
||||
|
||||
dmap = {}
|
||||
dmap["hello"] = 2
|
||||
dmap["hi"] = 4
|
||||
|
|
@ -34,3 +42,12 @@ hmap = example.halfi(dmap)
|
|||
print hmap
|
||||
print hmap.keys()
|
||||
print hmap.values()
|
||||
|
||||
|
||||
dmap = hmap
|
||||
|
||||
for i in dmap.iterkeys():
|
||||
print "key", i
|
||||
|
||||
for i in dmap.itervalues():
|
||||
print "val", i
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue