7 #include <pybind11/pybind11.h> 12 template <>
struct type_caster<std::chrono::year_month_day> {
14 PYBIND11_TYPE_CASTER(std::chrono::year_month_day, _(
"datetime.date"));
16 static handle
cast(std::chrono::year_month_day ymd, return_value_policy, handle) {
17 return pybind11::module_::import(
"datetime").attr(
"date")(
19 unsigned(ymd.month()),
static handle cast(std::chrono::year_month_day ymd, return_value_policy, handle)
Casts a std::chrono::year_month_day to a Python datetime.date object.
Definition: pybindSupp.h:16
Definition: pybindSupp.h:9