MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / PyStringSequenceCheck

Function PyStringSequenceCheck

oneflow/api/python/functional/common.cpp:112–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

TypeCheckMethod · 0.85

Calls 2

PySequenceCheckFunction · 0.85
PyStringCheckFunction · 0.85

Tested by

no test coverage detected