| 487 | // Bool support |
| 488 | |
| 489 | const char* ConvertOneBool(PyObject* v, bool* out) { |
| 490 | if (v == Py_True) { |
| 491 | *out = true; |
| 492 | } else if (v == Py_False) { |
| 493 | *out = false; |
| 494 | } else if (PyIsInstance(v, &PyBoolArrType_Type)) { // NumPy |
| 495 | *out = PyObject_IsTrue(v); |
| 496 | } else { |
| 497 | return ErrorMixedTypes; |
| 498 | } |
| 499 | return nullptr; |
| 500 | } |
| 501 | |
| 502 | DEFINE_HELPER(ConvertBool, bool, DT_BOOL, ConvertOneBool); |
| 503 |
nothing calls this directly
no test coverage detected