diff options
| author | Marcelo Matus <mmatus@acms.arizona.edu> | 2006-01-11 23:13:36 +0000 |
|---|---|---|
| committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2006-01-11 23:13:36 +0000 |
| commit | 54df37da81a8e88e673f3507c49d6733a1135a72 (patch) | |
| tree | c3fd86fbf4bc78314965c4d4a9a8edbf11c8948c /Examples/python/std_map | |
| parent | 219f667f7de703a780d2f80ef8f79bd842042a6f (diff) | |
| download | swig-54df37da81a8e88e673f3507c49d6733a1135a72.tar.gz | |
more examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8379 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/python/std_map')
| -rw-r--r-- | Examples/python/std_map/example.i | 3 | ||||
| -rw-r--r-- | Examples/python/std_map/runme.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Examples/python/std_map/example.i b/Examples/python/std_map/example.i index eb5794a57..1dcf8a536 100644 --- a/Examples/python/std_map/example.i +++ b/Examples/python/std_map/example.i @@ -24,3 +24,6 @@ namespace std { %template(halfd) half_map<std::string,double>; %template(halfi) half_map<std::string,int>; + +%template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>; +%template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>; diff --git a/Examples/python/std_map/runme.py b/Examples/python/std_map/runme.py index 39a77a9d6..b521c9c9c 100644 --- a/Examples/python/std_map/runme.py +++ b/Examples/python/std_map/runme.py @@ -2,6 +2,13 @@ import example +pmap = example.pymap() +pmap["hi"] = 1 +pmap["hello"] = 2 + + + + dmap = {} dmap["hello"] = 1.0 dmap["hi"] = 2.0 |
