MCPcopy Create free account
hub / github.com/bytedance/bolt / toString

Function toString

bolt/python/Utils.cpp:118–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118std::string toString(const pybind11::object& obj) {
119 return pyTry<std::string>(
120 [&]() -> std::string {
121 return obj.attr("__str__")().cast<pybind11::str>();
122 },
123 [&]() {
124 return fmt::format(
125 "Fail to get string representation of {}", pyTypeStr(obj));
126 });
127}
128
129std::string pickle(const pybind11::object& obj) {
130 return pyTry<std::string>([&]() {

Callers 3

applyMethod · 0.70
toStringMethod · 0.50
getInstanceMethod · 0.50

Calls 1

pyTypeStrFunction · 0.85

Tested by

no test coverage detected