[SciPy-user] weave inline returning a multimap to a dict nested within c++

Michael ODonnell odonnems@yahoo....
Fri Dec 14 00:13:45 CST 2007


I would like to convert a multimap created within c++ to a python dictionary in order to return the value. I think I need to do it this way because I have a multimap (potential for redundant keys) that needs to be sorted. I am using scipy.weave.inline with converters.blitz. If you think there is a better way I am open to what ever may work. Although, I prefer to stick with weave.inline blitz converter--This is all new and there are a lot of components to wrapping c++ in python.

Anyhow, I tired this:
py::dict ckmap_freq = map_freq;
return_val = ckmap_freq;

And received this error:
error: conversion from `std::multimap<double, std::string, std::less<double>, std::allocator<std::pair<const double, std::string> > >' to non-scalar type `py::dict' requested

I was able to successfully use a similar method but with a vector instead. Therefore, it is likely I need to change the syntax.

thanks for any suggestions and help,
Michael





      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071213/1b9810e3/attachment-0001.html 


More information about the SciPy-user mailing list