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

Function appendGenericArg

bolt/python/Utils.cpp:63–72  ·  view source on GitHub ↗

Append a VectorPtr to a python list of args with a direct cast to the pybolt python binding to VectorPtr.

Source from the content-addressed store, hash-verified

61// Append a VectorPtr to a python list of args with a direct cast
62// to the pybolt python binding to VectorPtr.
63void appendGenericArg(pybind11::list& args, const VectorPtr& arg) {
64 bolt::python::pyTry<void>(
65 [&]() { args.append(pybind11::cast(arg)); },
66 [&]() {
67 return fmt::format(
68 "Failed to cast bolt vector of type '{}' to a "
69 "python type.",
70 arg->type()->toString());
71 });
72}
73} // namespace
74
75namespace bolt::python {

Callers 1

asPyArgsFunction · 0.85

Calls 4

castFunction · 0.85
appendMethod · 0.45
toStringMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected