View the given Python object as unicode string
| 388 | |
| 389 | // View the given Python object as unicode string |
| 390 | Status ParseUnicode(PyObject* obj) { |
| 391 | // The utf-8 representation is cached on the unicode object |
| 392 | bytes = PyUnicode_AsUTF8AndSize(obj, &size); |
| 393 | RETURN_IF_PYERROR(); |
| 394 | is_utf8 = true; |
| 395 | return Status::OK(); |
| 396 | } |
| 397 | |
| 398 | // View the given Python object as binary-like, i.e. bytes |
| 399 | Status ParseBinary(PyObject* obj) { |