| 27 | bool check(PyObject *o) { return PyFloat_Check(o) != 0; } |
| 28 | |
| 29 | PyObject *conv(PyObject *o) { |
| 30 | PyObject *ret = nullptr; |
| 31 | if (PyLong_Check(o)) { |
| 32 | double v = PyLong_AsDouble(o); |
| 33 | if (!(v == -1.0 && PyErr_Occurred())) { |
| 34 | ret = PyFloat_FromDouble(v); |
| 35 | } |
| 36 | } else { |
| 37 | py::set_error(PyExc_TypeError, "Unexpected type"); |
| 38 | } |
| 39 | return ret; |
| 40 | } |
| 41 | |
| 42 | PyObject *default_constructed() { return PyFloat_FromDouble(0.0); } |
| 43 | } // namespace detail |
nothing calls this directly
no test coverage detected