Thanks! I can't express my gratitude for your help on this list. I think my questions are answered. I'll see if I can implement your solutions.
Werner > > But would you mind mentioning the other alternatives? My aim is to > > construct > the class like the "t=testmodule.Test("Hello")" above. > > In my opinion, you are working with "tricky" overloading - "char", > "char*" and "std::string". I could be wrong, but Python doesn't have > type "char", but string and unicode. So may be you should not expose > "Test(char)" and "Test(char*)" constructors at all. Anyway, > "pure/poor" Python user will/should not understand the difference > between those constructors. > > Another option, could be to create a Python class which derives from > the Test class ( you can rename it ) and implement dispatch logic by > yourself. You also can create fake constructor in C++, which takes > boost::python::object and makes the desired dispatching. > > > I was not able to use the suggested "create_*" functions as fake > > constructors > "test.add_fake_constructors( mb.calldefs( 'create_test_from_char' ) )". Do > they > have to return an auto_ptrfor this purpose? > > Yes. It was my mistake, sorry. > > HTH > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig