C++ -> Python: convert `Point2D` to `tuple[float, float]`. The second and third arguments are used to indicate the return value policy and parent object (for return_value_policy::reference_internal) and are often ignored by custom casters. The return value should reflect the type hint specified by the second argument of `io_name`.
| 32 | // return_value_policy::reference_internal) and are often ignored by custom casters. |
| 33 | // The return value should reflect the type hint specified by the second argument of `io_name`. |
| 34 | static handle |
| 35 | cast(const user_space::Point2D &number, return_value_policy /*policy*/, handle /*parent*/) { |
| 36 | return py::make_tuple(number.x, number.y).release(); |
| 37 | } |
| 38 | |
| 39 | // Python -> C++: convert a `PyObject` into a `Point2D` and return false upon failure. The |
| 40 | // second argument indicates whether implicit conversions should be allowed. |
no test coverage detected