more examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8379 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
219f667f7d
commit
54df37da81
2 changed files with 10 additions and 0 deletions
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
import example
|
||||
|
||||
pmap = example.pymap()
|
||||
pmap["hi"] = 1
|
||||
pmap["hello"] = 2
|
||||
|
||||
|
||||
|
||||
|
||||
dmap = {}
|
||||
dmap["hello"] = 1.0
|
||||
dmap["hi"] = 2.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue