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

Method get

include/pybind11/pytypes.h:1173–1179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171
1172 template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>
1173 static object get(handle obj, const IdxType &index) {
1174 PyObject *result = PySequence_GetItem(obj.ptr(), ssize_t_cast(index));
1175 if (!result) {
1176 throw error_already_set();
1177 }
1178 return reinterpret_steal<object>(result);
1179 }
1180
1181 template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>
1182 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