| 64 | namespace { |
| 65 | |
| 66 | std::string repr_pyobj(PyObject* obj) { |
| 67 | if (!obj) |
| 68 | return "<null PyObject>"; |
| 69 | PYTHON_GIL; |
| 70 | auto str = PyObject_Repr(obj); |
| 71 | if (!str) |
| 72 | return ssprintf("<PyObject at %p (repr failed)>", obj); |
| 73 | std::string ret{PyUnicode_AsUTF8(str)}; |
| 74 | Py_DECREF(str); |
| 75 | return ret; |
| 76 | } |
| 77 | |
| 78 | template <typename T> |
| 79 | std::string typeid_name(const T& t) { |
no outgoing calls
no test coverage detected