| 84 | const char* ConvertOneString(PyObject* v, string* out); |
| 85 | |
| 86 | string PyRepr(PyObject* obj) { |
| 87 | if (obj == nullptr) { |
| 88 | return "<null>"; |
| 89 | } |
| 90 | Safe_PyObjectPtr repr_obj = make_safe(PyObject_Repr(obj)); |
| 91 | if (repr_obj) { |
| 92 | string repr_str; |
| 93 | if (ConvertOneString(repr_obj.get(), &repr_str) == nullptr) { |
| 94 | return repr_str; |
| 95 | } |
| 96 | } |
| 97 | return "<error computing repr()>"; |
| 98 | } |
| 99 | |
| 100 | bool IsPyDimension(PyObject* obj) { |
| 101 | const char* tp_name = obj->ob_type->tp_name; |
no test coverage detected