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

Method set

include/pybind11/pytypes.h:1224–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {
1225 // PyTuple_SetItem steals a reference to 'val'
1226 if (PyTuple_SetItem(obj.ptr(), ssize_t_cast(index), val.inc_ref().ptr()) != 0) {
1227 throw error_already_set();
1228 }
1229 }
1230};
1231PYBIND11_NAMESPACE_END(accessor_policies)
1232

Callers

nothing calls this directly

Calls 3

ssize_t_castFunction · 0.85
ptrMethod · 0.80
inc_refMethod · 0.80

Tested by

no test coverage detected