• Home
  • Raw
  • Download

Lines Matching refs:descr

19 descr_dealloc(PyDescrObject *descr)  in descr_dealloc()  argument
21 _PyObject_GC_UNTRACK(descr); in descr_dealloc()
22 Py_XDECREF(descr->d_type); in descr_dealloc()
23 Py_XDECREF(descr->d_name); in descr_dealloc()
24 Py_XDECREF(descr->d_qualname); in descr_dealloc()
25 PyObject_GC_Del(descr); in descr_dealloc()
29 descr_name(PyDescrObject *descr) in descr_name() argument
31 if (descr->d_name != NULL && PyUnicode_Check(descr->d_name)) in descr_name()
32 return descr->d_name; in descr_name()
37 descr_repr(PyDescrObject *descr, const char *format) in descr_repr() argument
40 if (descr->d_name != NULL && PyUnicode_Check(descr->d_name)) in descr_repr()
41 name = descr->d_name; in descr_repr()
43 return PyUnicode_FromFormat(format, name, "?", descr->d_type->tp_name); in descr_repr()
47 method_repr(PyMethodDescrObject *descr) in method_repr() argument
49 return descr_repr((PyDescrObject *)descr, in method_repr()
54 member_repr(PyMemberDescrObject *descr) in member_repr() argument
56 return descr_repr((PyDescrObject *)descr, in member_repr()
61 getset_repr(PyGetSetDescrObject *descr) in getset_repr() argument
63 return descr_repr((PyDescrObject *)descr, in getset_repr()
68 wrapperdescr_repr(PyWrapperDescrObject *descr) in wrapperdescr_repr() argument
70 return descr_repr((PyDescrObject *)descr, in wrapperdescr_repr()
75 descr_check(PyDescrObject *descr, PyObject *obj) in descr_check() argument
77 if (!PyObject_TypeCheck(obj, descr->d_type)) { in descr_check()
81 descr_name((PyDescrObject *)descr), "?", in descr_check()
82 descr->d_type->tp_name, in descr_check()
90 classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type) in classmethod_get() argument
101 descr_name((PyDescrObject *)descr), "?", in classmethod_get()
102 PyDescr_TYPE(descr)->tp_name); in classmethod_get()
110 descr_name((PyDescrObject *)descr), "?", in classmethod_get()
111 PyDescr_TYPE(descr)->tp_name, in classmethod_get()
115 if (!PyType_IsSubtype((PyTypeObject *)type, PyDescr_TYPE(descr))) { in classmethod_get()
119 descr_name((PyDescrObject *)descr), "?", in classmethod_get()
120 PyDescr_TYPE(descr)->tp_name, in classmethod_get()
125 if (descr->d_method->ml_flags & METH_METHOD) { in classmethod_get()
126 cls = descr->d_common.d_type; in classmethod_get()
128 return PyCMethod_New(descr->d_method, type, NULL, cls); in classmethod_get()
132 method_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type) in method_get() argument
135 return Py_NewRef(descr); in method_get()
137 if (descr_check((PyDescrObject *)descr, obj) < 0) { in method_get()
140 if (descr->d_method->ml_flags & METH_METHOD) { in method_get()
142 return PyCMethod_New(descr->d_method, obj, NULL, descr->d_common.d_type); in method_get()
146 descr_name((PyDescrObject *)descr), in method_get()
151 return PyCFunction_NewEx(descr->d_method, obj, NULL); in method_get()
156 member_get(PyMemberDescrObject *descr, PyObject *obj, PyObject *type) in member_get() argument
159 return Py_NewRef(descr); in member_get()
161 if (descr_check((PyDescrObject *)descr, obj) < 0) { in member_get()
165 if (descr->d_member->flags & PY_AUDIT_READ) { in member_get()
167 obj ? obj : Py_None, descr->d_member->name) < 0) { in member_get()
172 return PyMember_GetOne((char *)obj, descr->d_member); in member_get()
176 getset_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *type) in getset_get() argument
179 return Py_NewRef(descr); in getset_get()
181 if (descr_check((PyDescrObject *)descr, obj) < 0) { in getset_get()
184 if (descr->d_getset->get != NULL) in getset_get()
185 return descr->d_getset->get(obj, descr->d_getset->closure); in getset_get()
188 descr_name((PyDescrObject *)descr), "?", in getset_get()
189 PyDescr_TYPE(descr)->tp_name); in getset_get()
194 wrapperdescr_get(PyWrapperDescrObject *descr, PyObject *obj, PyObject *type) in wrapperdescr_get() argument
197 return Py_NewRef(descr); in wrapperdescr_get()
199 if (descr_check((PyDescrObject *)descr, obj) < 0) { in wrapperdescr_get()
202 return PyWrapper_New((PyObject *)descr, obj); in wrapperdescr_get()
206 descr_setcheck(PyDescrObject *descr, PyObject *obj, PyObject *value) in descr_setcheck() argument
209 if (!PyObject_TypeCheck(obj, descr->d_type)) { in descr_setcheck()
213 descr_name(descr), "?", in descr_setcheck()
214 descr->d_type->tp_name, in descr_setcheck()
222 member_set(PyMemberDescrObject *descr, PyObject *obj, PyObject *value) in member_set() argument
224 if (descr_setcheck((PyDescrObject *)descr, obj, value) < 0) { in member_set()
227 return PyMember_SetOne((char *)obj, descr->d_member, value); in member_set()
231 getset_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) in getset_set() argument
233 if (descr_setcheck((PyDescrObject *)descr, obj, value) < 0) { in getset_set()
236 if (descr->d_getset->set != NULL) { in getset_set()
237 return descr->d_getset->set(obj, value, in getset_set()
238 descr->d_getset->closure); in getset_set()
242 descr_name((PyDescrObject *)descr), "?", in getset_set()
243 PyDescr_TYPE(descr)->tp_name); in getset_set()
475 classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args, in classmethoddescr_call() argument
483 descr_name((PyDescrObject *)descr), "?", in classmethoddescr_call()
484 PyDescr_TYPE(descr)->tp_name); in classmethoddescr_call()
488 PyObject *bound = classmethod_get(descr, NULL, self); in classmethoddescr_call()
499 wrapperdescr_raw_call(PyWrapperDescrObject *descr, PyObject *self, in wrapperdescr_raw_call() argument
502 wrapperfunc wrapper = descr->d_base->wrapper; in wrapperdescr_raw_call()
504 if (descr->d_base->flags & PyWrapperFlag_KEYWORDS) { in wrapperdescr_raw_call()
506 return (*wk)(self, args, descr->d_wrapped, kwds); in wrapperdescr_raw_call()
512 descr->d_base->name); in wrapperdescr_raw_call()
515 return (*wrapper)(self, args, descr->d_wrapped); in wrapperdescr_raw_call()
519 wrapperdescr_call(PyWrapperDescrObject *descr, PyObject *args, PyObject *kwds) in wrapperdescr_call() argument
531 descr_name((PyDescrObject *)descr), "?", in wrapperdescr_call()
532 PyDescr_TYPE(descr)->tp_name); in wrapperdescr_call()
537 (PyObject *)PyDescr_TYPE(descr))) { in wrapperdescr_call()
542 descr_name((PyDescrObject *)descr), "?", in wrapperdescr_call()
543 PyDescr_TYPE(descr)->tp_name, in wrapperdescr_call()
552 result = wrapperdescr_raw_call(descr, self, args, kwds); in wrapperdescr_call()
559 method_get_doc(PyMethodDescrObject *descr, void *closure) in method_get_doc() argument
561 return _PyType_GetDocFromInternalDoc(descr->d_method->ml_name, descr->d_method->ml_doc); in method_get_doc()
565 method_get_text_signature(PyMethodDescrObject *descr, void *closure) in method_get_text_signature() argument
567 … return _PyType_GetTextSignatureFromInternalDoc(descr->d_method->ml_name, descr->d_method->ml_doc); in method_get_text_signature()
571 calculate_qualname(PyDescrObject *descr) in calculate_qualname() argument
576 if (descr->d_name == NULL || !PyUnicode_Check(descr->d_name)) { in calculate_qualname()
582 type_qualname = _PyObject_GetAttrId((PyObject *)descr->d_type, in calculate_qualname()
594 res = PyUnicode_FromFormat("%S.%S", type_qualname, descr->d_name); in calculate_qualname()
600 descr_get_qualname(PyDescrObject *descr, void *Py_UNUSED(ignored)) in descr_get_qualname() argument
602 if (descr->d_qualname == NULL) in descr_get_qualname()
603 descr->d_qualname = calculate_qualname(descr); in descr_get_qualname()
604 Py_XINCREF(descr->d_qualname); in descr_get_qualname()
605 return descr->d_qualname; in descr_get_qualname()
609 descr_reduce(PyDescrObject *descr, PyObject *Py_UNUSED(ignored)) in descr_reduce() argument
612 PyDescr_TYPE(descr), PyDescr_NAME(descr)); in descr_reduce()
634 member_get_doc(PyMemberDescrObject *descr, void *closure) in member_get_doc() argument
636 if (descr->d_member->doc == NULL) { in member_get_doc()
639 return PyUnicode_FromString(descr->d_member->doc); in member_get_doc()
649 getset_get_doc(PyGetSetDescrObject *descr, void *closure) in getset_get_doc() argument
651 if (descr->d_getset->doc == NULL) { in getset_get_doc()
654 return PyUnicode_FromString(descr->d_getset->doc); in getset_get_doc()
664 wrapperdescr_get_doc(PyWrapperDescrObject *descr, void *closure) in wrapperdescr_get_doc() argument
666 return _PyType_GetDocFromInternalDoc(descr->d_base->name, descr->d_base->doc); in wrapperdescr_get_doc()
670 wrapperdescr_get_text_signature(PyWrapperDescrObject *descr, void *closure) in wrapperdescr_get_text_signature() argument
672 return _PyType_GetTextSignatureFromInternalDoc(descr->d_base->name, descr->d_base->doc); in wrapperdescr_get_text_signature()
685 PyDescrObject *descr = (PyDescrObject *)self; in descr_traverse() local
686 Py_VISIT(descr->d_type); in descr_traverse()
882 PyDescrObject *descr; in descr_new() local
884 descr = (PyDescrObject *)PyType_GenericAlloc(descrtype, 0); in descr_new()
885 if (descr != NULL) { in descr_new()
887 descr->d_type = type; in descr_new()
888 descr->d_name = PyUnicode_InternFromString(name); in descr_new()
889 if (descr->d_name == NULL) { in descr_new()
890 Py_DECREF(descr); in descr_new()
891 descr = NULL; in descr_new()
894 descr->d_qualname = NULL; in descr_new()
897 return descr; in descr_new()
935 PyMethodDescrObject *descr; in PyDescr_NewMethod() local
937 descr = (PyMethodDescrObject *)descr_new(&PyMethodDescr_Type, in PyDescr_NewMethod()
939 if (descr != NULL) { in PyDescr_NewMethod()
940 descr->d_method = method; in PyDescr_NewMethod()
941 descr->vectorcall = vectorcall; in PyDescr_NewMethod()
943 return (PyObject *)descr; in PyDescr_NewMethod()
949 PyMethodDescrObject *descr; in PyDescr_NewClassMethod() local
951 descr = (PyMethodDescrObject *)descr_new(&PyClassMethodDescr_Type, in PyDescr_NewClassMethod()
953 if (descr != NULL) in PyDescr_NewClassMethod()
954 descr->d_method = method; in PyDescr_NewClassMethod()
955 return (PyObject *)descr; in PyDescr_NewClassMethod()
961 PyMemberDescrObject *descr; in PyDescr_NewMember() local
963 descr = (PyMemberDescrObject *)descr_new(&PyMemberDescr_Type, in PyDescr_NewMember()
965 if (descr != NULL) in PyDescr_NewMember()
966 descr->d_member = member; in PyDescr_NewMember()
967 return (PyObject *)descr; in PyDescr_NewMember()
973 PyGetSetDescrObject *descr; in PyDescr_NewGetSet() local
975 descr = (PyGetSetDescrObject *)descr_new(&PyGetSetDescr_Type, in PyDescr_NewGetSet()
977 if (descr != NULL) in PyDescr_NewGetSet()
978 descr->d_getset = getset; in PyDescr_NewGetSet()
979 return (PyObject *)descr; in PyDescr_NewGetSet()
985 PyWrapperDescrObject *descr; in PyDescr_NewWrapper() local
987 descr = (PyWrapperDescrObject *)descr_new(&PyWrapperDescr_Type, in PyDescr_NewWrapper()
989 if (descr != NULL) { in PyDescr_NewWrapper()
990 descr->d_base = base; in PyDescr_NewWrapper()
991 descr->d_wrapped = wrapped; in PyDescr_NewWrapper()
993 return (PyObject *)descr; in PyDescr_NewWrapper()
1257 PyWrapperDescrObject *descr; member
1268 Py_XDECREF(wp->descr); in wrapper_dealloc()
1291 eq = (wa->descr == wb->descr && wa->self == wb->self); in wrapper_richcompare()
1305 y = _Py_HashPointer(wp->descr); in wrapper_hash()
1316 wp->descr->d_base->name, in wrapper_repr()
1325 wp->self, PyDescr_NAME(wp->descr)); in wrapper_reduce()
1341 PyObject *c = (PyObject *)PyDescr_TYPE(wp->descr); in wrapper_objclass()
1350 const char *s = wp->descr->d_base->name; in wrapper_name()
1358 return _PyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); in wrapper_doc()
1364 return _PyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc); in wrapper_text_signature()
1370 return descr_get_qualname((PyDescrObject *)wp->descr, NULL); in wrapper_qualname()
1385 return wrapperdescr_raw_call(wp->descr, wp->self, args, kwds); in wrapper_call()
1392 Py_VISIT(wp->descr); in wrapper_traverse()
1439 PyWrapperDescrObject *descr; in PyWrapper_New() local
1442 descr = (PyWrapperDescrObject *)d; in PyWrapper_New()
1444 (PyObject *)PyDescr_TYPE(descr))); in PyWrapper_New()
1448 Py_INCREF(descr); in PyWrapper_New()
1449 wp->descr = descr; in PyWrapper_New()