| 43 | } |
| 44 | |
| 45 | bool IsPyInt(PyObject* obj) { |
| 46 | #if PY_MAJOR_VERSION >= 3 |
| 47 | return PyLong_Check(obj) || |
| 48 | PyIsInstance(obj, &PyIntegerArrType_Type); // NumPy integers |
| 49 | #else |
| 50 | return PyInt_Check(obj) || PyLong_Check(obj) || |
| 51 | PyIsInstance(obj, &PyIntegerArrType_Type); // NumPy integers |
| 52 | #endif |
| 53 | } |
| 54 | |
| 55 | bool IsPyDouble(PyObject* obj) { |
| 56 | return PyIsInstance(obj, &PyDoubleArrType_Type); // NumPy double type. |
no test coverage detected