• Home
  • Raw
  • Download

Lines Matching +full:no +full:- +full:eq +full:- +full:null

34     return PyCFunction_NewEx(ml, self, NULL);  in PyCFunction_New()
40 return PyCMethod_New(ml, self, module, NULL); in PyCFunction_NewEx()
48 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | in PyCMethod_New()
55 vectorcall = NULL; in PyCMethod_New()
74 "%s() method: bad call flags", ml->ml_name); in PyCMethod_New()
75 return NULL; in PyCMethod_New()
78 PyCFunctionObject *op = NULL; in PyCMethod_New()
80 if (ml->ml_flags & METH_METHOD) { in PyCMethod_New()
84 "flag but no class"); in PyCMethod_New()
85 return NULL; in PyCMethod_New()
88 if (om == NULL) { in PyCMethod_New()
89 return NULL; in PyCMethod_New()
92 om->mm_class = cls; in PyCMethod_New()
98 "but no METH_METHOD flag"); in PyCMethod_New()
99 return NULL; in PyCMethod_New()
102 if (op == NULL) { in PyCMethod_New()
103 return NULL; in PyCMethod_New()
107 op->m_weakreflist = NULL; in PyCMethod_New()
108 op->m_ml = ml; in PyCMethod_New()
110 op->m_self = self; in PyCMethod_New()
112 op->m_module = module; in PyCMethod_New()
113 op->vectorcall = vectorcall; in PyCMethod_New()
123 return NULL; in PyCFunction_GetFunction()
133 return NULL; in PyCFunction_GetSelf()
143 return -1; in PyCFunction_GetFlags()
153 return NULL; in PyCMethod_GetClass()
158 /* Methods (the standard built-in methods, that is) */
167 if (m->m_weakreflist != NULL) { in meth_dealloc()
173 Py_XDECREF(m->m_self); in meth_dealloc()
174 Py_XDECREF(m->m_module); in meth_dealloc()
184 if (m->m_self == NULL || PyModule_Check(m->m_self)) in meth_reduce()
185 return PyUnicode_FromString(m->m_ml->ml_name); in meth_reduce()
188 m->m_self, m->m_ml->ml_name); in meth_reduce()
192 {"__reduce__", (PyCFunction)meth_reduce, METH_NOARGS, NULL},
193 {NULL, NULL}
199 return _PyType_GetTextSignatureFromInternalDoc(m->m_ml->ml_name, m->m_ml->ml_doc); in meth_get__text_signature__()
205 return _PyType_GetDocFromInternalDoc(m->m_ml->ml_name, m->m_ml->ml_doc); in meth_get__doc__()
211 return PyUnicode_FromString(m->m_ml->ml_name); in meth_get__name__()
217 /* If __self__ is a module or NULL, return m.__name__ in meth_get__qualname__()
228 if (m->m_self == NULL || PyModule_Check(m->m_self)) in meth_get__qualname__()
229 return PyUnicode_FromString(m->m_ml->ml_name); in meth_get__qualname__()
231 type = PyType_Check(m->m_self) ? m->m_self : (PyObject*)Py_TYPE(m->m_self); in meth_get__qualname__()
234 if (type_qualname == NULL) in meth_get__qualname__()
235 return NULL; in meth_get__qualname__()
241 return NULL; in meth_get__qualname__()
244 res = PyUnicode_FromFormat("%S.%s", type_qualname, m->m_ml->ml_name); in meth_get__qualname__()
253 Py_VISIT(m->m_self); in meth_traverse()
254 Py_VISIT(m->m_module); in meth_traverse()
264 if (self == NULL) in meth_get__self__()
271 {"__doc__", (getter)meth_get__doc__, NULL, NULL},
272 {"__name__", (getter)meth_get__name__, NULL, NULL},
273 {"__qualname__", (getter)meth_get__qualname__, NULL, NULL},
274 {"__self__", (getter)meth_get__self__, NULL, NULL},
275 {"__text_signature__", (getter)meth_get__text_signature__, NULL, NULL},
283 {NULL}
289 if (m->m_self == NULL || PyModule_Check(m->m_self)) in meth_repr()
290 return PyUnicode_FromFormat("<built-in function %s>", in meth_repr()
291 m->m_ml->ml_name); in meth_repr()
292 return PyUnicode_FromFormat("<built-in method %s of %s object at %p>", in meth_repr()
293 m->m_ml->ml_name, in meth_repr()
294 Py_TYPE(m->m_self)->tp_name, in meth_repr()
295 m->m_self); in meth_repr()
303 int eq; in meth_richcompare() local
313 eq = a->m_self == b->m_self; in meth_richcompare()
314 if (eq) in meth_richcompare()
315 eq = a->m_ml->ml_meth == b->m_ml->ml_meth; in meth_richcompare()
317 res = eq ? Py_True : Py_False; in meth_richcompare()
319 res = eq ? Py_False : Py_True; in meth_richcompare()
328 x = _Py_HashPointer(a->m_self); in meth_hash()
329 y = _Py_HashPointer((void*)(a->m_ml->ml_meth)); in meth_hash()
331 if (x == -1) in meth_hash()
332 x = -2; in meth_hash()
394 if (funcstr != NULL) { in cfunction_check_kwargs()
396 "%U takes no keyword arguments", funcstr); in cfunction_check_kwargs()
399 return -1; in cfunction_check_kwargs()
410 return NULL; in cfunction_enter_call()
422 return NULL; in cfunction_vectorcall_FASTCALL()
427 if (meth == NULL) { in cfunction_vectorcall_FASTCALL()
428 return NULL; in cfunction_vectorcall_FASTCALL()
443 if (meth == NULL) { in cfunction_vectorcall_FASTCALL_KEYWORDS()
444 return NULL; in cfunction_vectorcall_FASTCALL_KEYWORDS()
459 if (meth == NULL) { in cfunction_vectorcall_FASTCALL_KEYWORDS_METHOD()
460 return NULL; in cfunction_vectorcall_FASTCALL_KEYWORDS_METHOD()
473 return NULL; in cfunction_vectorcall_NOARGS()
478 if (funcstr != NULL) { in cfunction_vectorcall_NOARGS()
480 "%U takes no arguments (%zd given)", funcstr, nargs); in cfunction_vectorcall_NOARGS()
483 return NULL; in cfunction_vectorcall_NOARGS()
486 if (meth == NULL) { in cfunction_vectorcall_NOARGS()
487 return NULL; in cfunction_vectorcall_NOARGS()
489 PyObject *result = meth(PyCFunction_GET_SELF(func), NULL); in cfunction_vectorcall_NOARGS()
500 return NULL; in cfunction_vectorcall_O()
505 if (funcstr != NULL) { in cfunction_vectorcall_O()
510 return NULL; in cfunction_vectorcall_O()
513 if (meth == NULL) { in cfunction_vectorcall_O()
514 return NULL; in cfunction_vectorcall_O()
525 assert(kwargs == NULL || PyDict_Check(kwargs)); in cfunction_call()
537 * is NULL. This is intentional, since vectorcall would be slower. */ in cfunction_call()
546 if (kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) { in cfunction_call()
548 "%.200s() takes no keyword arguments", in cfunction_call()
549 ((PyCFunctionObject*)func)->m_ml->ml_name); in cfunction_call()
550 return NULL; in cfunction_call()
554 return _Py_CheckFunctionResult(tstate, func, result, NULL); in cfunction_call()