Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-06-10 10:27:00


on Sun Jun 10 2007, "Marcin Kalicinski" <kalita-AT-poczta.onet.pl> wrote:

> python::dict m_mainNamespace = python::dict(m_mainModule.attr("__dict__"));
>
> The above code makes a copy of mainModule dictionary.

Just as in python,

     dict( some_other_dict )

makes a copy.

> Is it possible to make
> m_mainNamespace not a copy but a reference to mainModule dictionary?

See http://www.boost.org/libs/python/doc/tutorial/doc/html/python/object.html#python.extracting_c___objects

Joel, it seems to me that there should be a link to this bit in the
previous section so the person who doesn't read the whole tutorial
through isn't left wondering if there's an answer.

Agree?

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net