Append a VectorPtr to a python list of args with a direct cast to the pybolt python binding to VectorPtr.
| 61 | // Append a VectorPtr to a python list of args with a direct cast |
| 62 | // to the pybolt python binding to VectorPtr. |
| 63 | void 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 | |
| 75 | namespace bolt::python { |