[C++-sig] [boost.python] object: Assignment vs Construction
dave at boostpro.com
Fri Oct 10 20:25:51 CEST 2008
on Thu Oct 09 2008, Robert <rcdailey-AT-gmail.com> wrote:
> I've noticed in various situations that assignment and construction of
> boost::python::object types do not do the same thing. For example, these two lines of
> code below are different at runtime:
> dict ns = extract<dict>( import( "sys" ).attr( "__dict__" ) );
> -- <vs> --
> dict ns( extract<dict>( import( "sys" ).attr( "__dict__" ) ) );
> The latter of the two will cause an exception at runtime.
> Why are these different and what is each meant to do?
I think they should be the same.
More information about the Cplusplus-sig