Home
last modified time | relevance | path

Searched refs:tp_as_number (Results 1 – 25 of 43) sorted by relevance

12

/external/python/cpython3/Include/internal/
Dpycore_abstract.h15 PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number; in _PyIndex_Check() local
16 return (tp_as_number != NULL && tp_as_number->nb_index != NULL); in _PyIndex_Check()
/external/python/cpython3/Objects/
Dboolobject.c64 return PyLong_Type.tp_as_number->nb_and(a, b); in bool_and()
72 return PyLong_Type.tp_as_number->nb_or(a, b); in bool_or()
80 return PyLong_Type.tp_as_number->nb_xor(a, b); in bool_xor()
Dabstract.c822 return o && Py_TYPE(o)->tp_as_number && in PyNumber_Check()
823 (Py_TYPE(o)->tp_as_number->nb_index || in PyNumber_Check()
824 Py_TYPE(o)->tp_as_number->nb_int || in PyNumber_Check()
825 Py_TYPE(o)->tp_as_number->nb_float); in PyNumber_Check()
853 if (Py_TYPE(v)->tp_as_number != NULL) in binary_op1()
854 slotv = NB_BINOP(Py_TYPE(v)->tp_as_number, op_slot); in binary_op1()
856 Py_TYPE(w)->tp_as_number != NULL) { in binary_op1()
857 slotw = NB_BINOP(Py_TYPE(w)->tp_as_number, op_slot); in binary_op1()
942 mv = Py_TYPE(v)->tp_as_number; in ternary_op()
943 mw = Py_TYPE(w)->tp_as_number; in ternary_op()
[all …]
Dtypeobject.c2615 type->tp_as_number = &et->as_number; in type_new()
2993 type->tp_as_number = &res->as_number; in PyType_FromModuleAndSpec()
5193 #define COPYNUM(SLOT) COPYSLOT(tp_as_number->SLOT) in inherit_slots()
5201 if (type->tp_as_number != NULL && base->tp_as_number != NULL) { in inherit_slots()
5203 if (basebase->tp_as_number == NULL) in inherit_slots()
5570 if (type->tp_as_number == NULL) in PyType_Ready()
5571 type->tp_as_number = base->tp_as_number; in PyType_Ready()
6322 Py_TYPE(other)->tp_as_number != NULL && \
6323 Py_TYPE(other)->tp_as_number->SLOTNAME == TESTFUNC; \
6324 if (Py_TYPE(self)->tp_as_number != NULL && \
[all …]
Dcomplexobject.c961 nbr = Py_TYPE(r)->tp_as_number; in complex_new_impl()
973 nbi = Py_TYPE(i)->tp_as_number; in complex_new_impl()
Dfloatobject.c248 nb = Py_TYPE(op)->tp_as_number; in PyFloat_AsDouble()
761 return PyComplex_Type.tp_as_number->nb_power(v, w, z); in float_pow()
1525 PyNumberMethods *long_methods = PyLong_Type.tp_as_number; in float_as_integer_ratio_impl()
Dobject.c1402 else if (Py_TYPE(v)->tp_as_number != NULL && in PyObject_IsTrue()
1403 Py_TYPE(v)->tp_as_number->nb_bool != NULL) in PyObject_IsTrue()
1404 res = (*Py_TYPE(v)->tp_as_number->nb_bool)(v); in PyObject_IsTrue()
/external/python/cpython2/Objects/
Dboolobject.c73 return PyInt_Type.tp_as_number->nb_and(a, b); in bool_and()
82 return PyInt_Type.tp_as_number->nb_or(a, b); in bool_or()
91 return PyInt_Type.tp_as_number->nb_xor(a, b); in bool_xor()
Dintobject.c152 if (op == NULL || (nb = Py_TYPE(op)->tp_as_number) == NULL || in PyInt_AsLong()
224 if ((nb = Py_TYPE(op)->tp_as_number) == NULL || in PyInt_AsSsize_t()
273 if (op == NULL || (nb = Py_TYPE(op)->tp_as_number) == NULL || in PyInt_AsUnsignedLongMask()
318 if (op == NULL || (nb = Py_TYPE(op)->tp_as_number) == NULL || in PyInt_AsUnsignedLongLongMask()
478 return PyLong_Type.tp_as_number->nb_add((PyObject *)v, (PyObject *)w); in int_add()
491 return PyLong_Type.tp_as_number->nb_subtract((PyObject *)v, in int_sub()
556 return PyLong_Type.tp_as_number->nb_multiply(v, w); in int_mul()
629 return PyLong_Type.tp_as_number->nb_divide((PyObject *)x, in int_div()
650 return PyLong_Type.tp_as_number->nb_divide((PyObject *)x, in int_classic_div()
680 return PyLong_Type.tp_as_number->nb_true_divide( in int_true_divide()
[all …]
Dabstract.c885 return o && o->ob_type->tp_as_number &&
886 (o->ob_type->tp_as_number->nb_int ||
887 o->ob_type->tp_as_number->nb_float);
929 if (v->ob_type->tp_as_number != NULL && NEW_STYLE_NUMBER(v))
930 slotv = NB_BINOP(v->ob_type->tp_as_number, op_slot);
932 w->ob_type->tp_as_number != NULL && NEW_STYLE_NUMBER(w)) {
933 slotw = NB_BINOP(w->ob_type->tp_as_number, op_slot);
962 PyNumberMethods *mv = v->ob_type->tp_as_number;
1047 mv = v->ob_type->tp_as_number;
1048 mw = w->ob_type->tp_as_number;
[all …]
Dobject.c1581 else if (v->ob_type->tp_as_number != NULL && in PyObject_IsTrue()
1582 v->ob_type->tp_as_number->nb_nonzero != NULL) in PyObject_IsTrue()
1583 res = (*v->ob_type->tp_as_number->nb_nonzero)(v); in PyObject_IsTrue()
1631 if (v->ob_type->tp_as_number && v->ob_type->tp_as_number->nb_coerce) { in PyNumber_CoerceEx()
1632 res = (*v->ob_type->tp_as_number->nb_coerce)(pv, pw); in PyNumber_CoerceEx()
1636 if (w->ob_type->tp_as_number && w->ob_type->tp_as_number->nb_coerce) { in PyNumber_CoerceEx()
1637 res = (*w->ob_type->tp_as_number->nb_coerce)(pw, pv); in PyNumber_CoerceEx()
Dtypeobject.c2364 (base->tp_as_number == NULL)) in type_new()
2368 type->tp_as_number = &et->as_number; in type_new()
3827 if ((!type->tp_as_number && base->tp_as_number) ||
3830 if (!type->tp_as_number && !type->tp_as_sequence) {
3837 if (!type->tp_as_number && base->tp_as_number) {
3945 #define COPYNUM(SLOT) COPYSLOT(tp_as_number->SLOT)
3953 if (type->tp_as_number != NULL && base->tp_as_number != NULL) {
3955 if (basebase->tp_as_number == NULL)
4285 if (type->tp_as_number == NULL)
4286 type->tp_as_number = base->tp_as_number;
[all …]
Dcomplexobject.c1186 nbr = r->ob_type->tp_as_number; in complex_new()
1188 nbi = i->ob_type->tp_as_number; in complex_new()
Dfloatobject.c273 if ((nb = Py_TYPE(op)->tp_as_number) == NULL || nb->nb_float == NULL) { in PyFloat_AsDouble()
1721 PyNumberMethods *long_methods = PyLong_Type.tp_as_number; in float_as_integer_ratio()
/external/python/cpython2/Doc/includes/
Dtypestruct.h17 PyNumberMethods *tp_as_number; member
/external/python/cpython3/Doc/includes/
Dtypestruct.h18 PyNumberMethods *tp_as_number; member
/external/python/cpython2/Modules/
D_randommodule.c237 n = PyInt_Type.tp_as_number->nb_absolute(arg); in random_seed()
240 n = PyLong_Type.tp_as_number->nb_absolute(arg); in random_seed()
/external/python/cpython2/Include/
Dabstract.h849 ((obj)->ob_type->tp_as_number != NULL && \
851 (obj)->ob_type->tp_as_number->nb_index != NULL)
Dobject.h340 PyNumberMethods *tp_as_number; member
/external/tensorflow/tensorflow/python/lib/core/
Dbfloat16.cc184 return PyArray_Type.tp_as_number->nb_add(a, b); in PyBfloat16_Add()
192 return PyArray_Type.tp_as_number->nb_subtract(a, b); in PyBfloat16_Subtract()
200 return PyArray_Type.tp_as_number->nb_multiply(a, b); in PyBfloat16_Multiply()
208 return PyArray_Type.tp_as_number->nb_true_divide(a, b); in PyBfloat16_TrueDivide()
/external/python/cpython3/Include/cpython/
Dobject.h210 PyNumberMethods *tp_as_number; member
/external/python/pybind11/include/pybind11/
Dcast.h1205 else if (auto tp_as_number = src.ptr()->ob_type->tp_as_number) {
1206 if (PYBIND11_NB_BOOL(tp_as_number)) {
1207 res = (*PYBIND11_NB_BOOL(tp_as_number))(src.ptr());
/external/python/cpython2/Doc/c-api/
Dtypeobj.rst293 .. c:member:: PyNumberMethods* tp_as_number
299 The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the contained fields are
422 …:c:member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject.tp_as_sequence`, :c:member:`~PyTy…
467 … :c:member:`~PyTypeObject.tp_as_number` contain the fields for in-place operators. In particular,
481 … :c:type:`PyNumberMethods` structure referenced by :c:member:`~PyTypeObject.tp_as_number` accept
1286 addition via the :c:member:`~PyTypeObject.tp_as_number.nb_add` slot.
1292 multiplication via the :c:member:`~PyTypeObject.tp_as_number.nb_multiply`
/external/python/cpython2/Python/
Dbltinmodule.c1212 if ((nb = v->ob_type->tp_as_number) == NULL || in builtin_hex()
1480 if (v == NULL || (nb = v->ob_type->tp_as_number) == NULL || in builtin_oct()
1788 (nb = Py_TYPE(arg)->tp_as_number) == NULL || in get_range_long_argument()
/external/python/pybind11/include/pybind11/detail/
Dclass.h666 type->tp_as_number = &heap_type->as_number; in make_new_python_type()

12