MCPcopy Create free account
hub / github.com/pybind/pybind11 / get

Method get

include/pybind11/pytypes.h:1215–1221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213
1214 template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>
1215 static object get(handle obj, const IdxType &index) {
1216 PyObject *result = PyTuple_GetItem(obj.ptr(), ssize_t_cast(index));
1217 if (!result) {
1218 throw error_already_set();
1219 }
1220 return reinterpret_borrow<object>(result);
1221 }
1222
1223 template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>
1224 static void set(handle obj, const IdxType &index, handle val) {

Callers

nothing calls this directly

Calls 2

ssize_t_castFunction · 0.85
ptrMethod · 0.80

Tested by

no test coverage detected