#17 Generate __str__ method if operator<< exists

open
nobody
None
5
2012-01-05
2012-01-05
No

According to http://www.boost.org/doc/libs/1_48_0/libs/python/doc/tutorial/doc/html/python/exposing.html#python.class_operators_special_functions, the boost::python::class_<...>::def member function will assign a __str__ method to the class that it's exposing when it's called with a single argument of value boost::python::self_ns::str(boost::python::self).

Therefore, Py++ could easily generate a Klass. __str__ method for an exposed class Klass if its code creator were to output ".def(bp::self_ns::str(bp::self))" in response to the existence of a std::ostream& operator<<(std::ostream&, Klass const&) free function.

This feature is lacking in revision 1856.

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks