[boost.python] is it possible to make python::dict wrap an existing python dictionary object instead of making a copy?
python::dict m_mainNamespace = python::dict(m_mainModule.attr("__dict__")); The above code makes a copy of mainModule dictionary. Is it possible to make m_mainNamespace not a copy but a reference to mainModule dictionary? Marcin
on Sun Jun 10 2007, "Marcin Kalicinski"
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#py... 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
participants (2)
-
David Abrahams
-
Marcin Kalicinski