| 129 | } |
| 130 | |
| 131 | inline std::vector<std::string> ListObjectAttributes(const py::object& pyself) { |
| 132 | std::vector<std::string> attributes; |
| 133 | for (const auto& handle : pyself.attr("__dir__")()) { |
| 134 | const py::str attribute = py::reinterpret_borrow<py::str>(handle); |
| 135 | const auto value = pyself.attr(attribute); |
| 136 | if (AttributeIsFunction(attribute, value)) { |
| 137 | continue; |
| 138 | } |
| 139 | attributes.push_back(attribute); |
| 140 | } |
| 141 | return attributes; |
| 142 | } |
| 143 | |
| 144 | template <typename T, typename... options> |
| 145 | py::dict ConvertToDict(const T& self, |
no test coverage detected