Lines Matching refs:PyObject

24 #  define PYBIND11_SET_OLDPY_QUALNAME(obj, nameobj) setattr((PyObject *) obj, "__qualname__", nameobj)
35 extern "C" inline PyObject *pybind11_static_get(PyObject *self, PyObject * /*ob*/, PyObject *cls) {
40 extern "C" inline int pybind11_static_set(PyObject *self, PyObject *obj, PyObject *value) {
41 PyObject *cls = PyType_Check(obj) ? obj : (PyObject *) Py_TYPE(obj);
75 setattr((PyObject *) type, "__module__", str("pybind11_builtins"));
88 PyObject *result = PyRun_String(R"(\
110 extern "C" inline int pybind11_meta_setattro(PyObject* obj, PyObject* name, PyObject* value) {
113 PyObject *descr = _PyType_Lookup((PyTypeObject *) obj, name);
119 const auto static_prop = (PyObject *) get_internals().static_property_type;
127 if (PyObject *result = PyObject_CallMethod(descr, "__set__", "OO", obj, value)) {
147 extern "C" inline PyObject *pybind11_meta_getattro(PyObject *obj, PyObject *name) {
148 PyObject *descr = _PyType_Lookup((PyTypeObject *) obj, name);
192 setattr((PyObject *) type, "__module__", str("pybind11_builtins"));
250 inline PyObject *make_new_instance(PyTypeObject *type) {
259 PyObject *self = type->tp_alloc(type, 0);
271 extern "C" inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject *, PyObject *) {
278 extern "C" inline int pybind11_object_init(PyObject *self, PyObject *, PyObject *) {
282 msg += handle((PyObject *) type).attr("__module__").cast<std::string>() + ".";
290 inline void add_patient(PyObject *nurse, PyObject *patient) {
298 inline void clear_patients(PyObject *self) {
309 for (PyObject *&patient : patients)
315 inline void clear_instance(PyObject *self) {
337 PyObject **dict_ptr = _PyObject_GetDictPtr(self);
347 extern "C" inline void pybind11_object_dealloc(PyObject *self) {
365 inline PyObject *make_object_base_type(PyTypeObject *metaclass) {
398 setattr((PyObject *) type, "__module__", str("pybind11_builtins"));
402 return (PyObject *) heap_type;
406 extern "C" inline PyObject *pybind11_get_dict(PyObject *self, void *) {
407 PyObject *&dict = *_PyObject_GetDictPtr(self);
415 extern "C" inline int pybind11_set_dict(PyObject *self, PyObject *new_dict, void *) {
421 PyObject *&dict = *_PyObject_GetDictPtr(self);
429 extern "C" inline int pybind11_traverse(PyObject *self, visitproc visit, void *arg) {
430 PyObject *&dict = *_PyObject_GetDictPtr(self);
436 extern "C" inline int pybind11_clear(PyObject *self) {
437 PyObject *&dict = *_PyObject_GetDictPtr(self);
452 type->tp_basicsize += (ssize_t)sizeof(PyObject *); // and allocate enough space for it
464 extern "C" inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int flags) {
500 extern "C" inline void pybind11_releasebuffer(PyObject *, Py_buffer *view) {
517 inline PyObject* make_new_python_type(const type_record &rec) {
613 setattr(rec.scope, rec.name, (PyObject *) type);
618 setattr((PyObject *) type, "__module__", module);
622 return (PyObject *) type;