[C++-sig] py++ na namespace

Hans Meine meine at informatik.uni-hamburg.de
Tue Sep 4 14:12:29 CEST 2007


Am Dienstag, 04. September 2007 12:14:48 schrieb Libor Capak:
> but py++ doesn't create "sub-module" A and function foo() is at
> "basic level". What about handle this situation this way: ?
>
> bp::handle<> m(PyModule_New("A"));
> bp::scope().attr("A") = m;
> bp::scope s = bp::object(m);
> def("foo", &A::foo);

What about pickling?  Does that work or do you get "XY is not found as 'foo'" 
or similar?

-- 
Ciao, /  /
     /--/
    /  / ANS



More information about the Cplusplus-sig mailing list