[C++-sig] HOWTO: ...create shallow boost::python::object copies ?

Stefan Seefeld seefeld at sympatico.ca
Thu Jan 24 19:56:59 CET 2008


Ralf W. Grosse-Kunstleve wrote:
> Hi Stefan, look for "astute" on this page:
> http://www.boost.org/libs/python/doc/tutorial/doc/html/python/object.html

Hi Ralf,

yes, I have seen that. However, unfortunately that only tells me that a 
copy is to be expected there. It doesn't tell me how I can make a 
reference.

The reason for me creating a bpl::dict object is to be able to access 
the dict-specific methods (such as get()) which aren't available when I 
access the object. So, how can I cast to a derived type without a 
temporary ?

bpl::dict d = some_cast(o.attr("a_dict_member"));

??

Thanks,		Stefan

-- 

       ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list