[C++-sig] python namespace
Francois Ostiguy
ostiguy at fnal.gov
Wed Nov 20 23:15:00 CET 2002
> > BOOST_PYTHON_MODULE(outer)
> > {
> >
> >
> > python::handle<> inner_module1( PyModule_New("outer.inner1"));
> > python::scope inner_scope1 = object(inner_module1);
> don't you need `python::' here?--^
> >
> > python::def("f1", &f1);
> >
> > python::handle<> inner_module2( PyModule_New("outer.inner2"));
> > python::scope inner_scope2 = object(inner_module2);
> don't you need `python::' here?--^
> >
> > python::def("f2", &f2);
> >
> > }
Dave -
you are correct. I forgot to use python::object instead of object in
this version of my simplified example. I tried many permutations
and I used the the wrong one in my post.
The corrected version still does not compile:
/usr/local/ap/include/boost/utility.hpp: In copy constructor
`boost::python::scope::scope(const boost::python::scope&)':
/usr/local/ap/include/boost/utility.hpp:55: `
boost::noncopyable::noncopyable(const boost::noncopyable&)' is private
namespace.cc:29: within this context
namespace.cc: In function `void init_module_outer()':
namespace.cc:29: initializing temporary from result of `
boost::python::scope::scope(const boost::python::api::object&)'
gmake: *** [namespace.o] Error 1
-Francois
----------------------------------------------------------------------------
Dr. Jean-Francois OSTIGUY voice: (630) 840-2231
Beam Physics Dept MS220 FAX: (630) 840-6039
Fermi National Accelerator Laboratory email: ostiguy at fnal.gov
Batavia IL 60510-0500 WWW:www-ap.fnal.gov/~ostiguy
More information about the Cplusplus-sig
mailing list