I'd like to make boost::gregorian::date available to Python using Boost.Python. But how do I create a decent __str__
function when one is not available on the Boost date class? I'd like to write it like this:
BOOST_PYTHON_MODULE(mymodule)
{
class_<boost::gregorian::date>("Date")
.add_property("year", &boost::gregorian::date::year)
.add_property("month", &boost::gregorian::date::month)
.def("__str__", ???)
;
}