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

Method get

include/pybind11/pytypes.h:1154–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152 using key_type = object;
1153
1154 static object get(handle obj, handle key) {
1155 PyObject *result = PyObject_GetItem(obj.ptr(), key.ptr());
1156 if (!result) {
1157 throw error_already_set();
1158 }
1159 return reinterpret_steal<object>(result);
1160 }
1161
1162 static void set(handle obj, handle key, handle val) {
1163 if (PyObject_SetItem(obj.ptr(), key.ptr(), val.ptr()) != 0) {

Callers

nothing calls this directly

Calls 1

ptrMethod · 0.80

Tested by

no test coverage detected