| 110 | bool PyStringCheck(PyObject* obj) { return PyBytes_Check(obj) || PyUnicode_Check(obj); } |
| 111 | |
| 112 | bool PyStringSequenceCheck(PyObject* obj) { |
| 113 | return PySequenceCheck(obj, [](PyObject* item) { return PyStringCheck(item); }); |
| 114 | } |
| 115 | |
| 116 | std::string PyStringAsString(PyObject* obj) { |
| 117 | PyObject* bytes = PyUnicode_AsEncodedString(obj, "utf-8", "~E~"); |
no test coverage detected