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

Libor Capak capak at inputwish.com
Tue Sep 4 12:14:48 CEST 2007


Hi,

i'm learning py++ and i have following problem:

c++:

namespace A { void foo(); }

generated file by py++ contains something like that:

bp::def("foo", &A::foo);

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);

or did i overpass some simple solution in documentation?
thanks

Libor Capak



More information about the Cplusplus-sig mailing list