Home
last modified time | relevance | path

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

12

/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.c761 return o && o->ob_type->tp_as_number && in PyNumber_Check()
762 (o->ob_type->tp_as_number->nb_index || in PyNumber_Check()
763 o->ob_type->tp_as_number->nb_int || in PyNumber_Check()
764 o->ob_type->tp_as_number->nb_float); in PyNumber_Check()
792 if (v->ob_type->tp_as_number != NULL) in binary_op1()
793 slotv = NB_BINOP(v->ob_type->tp_as_number, op_slot); in binary_op1()
795 w->ob_type->tp_as_number != NULL) { in binary_op1()
796 slotw = NB_BINOP(w->ob_type->tp_as_number, op_slot); in binary_op1()
881 mv = v->ob_type->tp_as_number; in ternary_op()
882 mw = w->ob_type->tp_as_number; in ternary_op()
[all …]
Dtypeobject.c2584 type->tp_as_number = &et->as_number; in type_new()
2929 type->tp_as_number = &res->as_number; in PyType_FromSpecWithBases()
5055 #define COPYNUM(SLOT) COPYSLOT(tp_as_number->SLOT) in inherit_slots()
5063 if (type->tp_as_number != NULL && base->tp_as_number != NULL) { in inherit_slots()
5065 if (basebase->tp_as_number == NULL) in inherit_slots()
5431 if (type->tp_as_number == NULL) in PyType_Ready()
5432 type->tp_as_number = base->tp_as_number; in PyType_Ready()
6148 Py_TYPE(other)->tp_as_number != NULL && \
6149 Py_TYPE(other)->tp_as_number->SLOTNAME == TESTFUNC; \
6150 if (Py_TYPE(self)->tp_as_number != NULL && \
[all …]
Dcomplexobject.c993 nbr = r->ob_type->tp_as_number; in complex_new_impl()
1005 nbi = i->ob_type->tp_as_number; in complex_new_impl()
Dobject.c1454 else if (v->ob_type->tp_as_number != NULL && in PyObject_IsTrue()
1455 v->ob_type->tp_as_number->nb_bool != NULL) in PyObject_IsTrue()
1456 res = (*v->ob_type->tp_as_number->nb_bool)(v); in PyObject_IsTrue()
Dfloatobject.c247 nb = Py_TYPE(op)->tp_as_number; in PyFloat_AsDouble()
766 return PyComplex_Type.tp_as_number->nb_power(v, w, z); in float_pow()
1555 PyNumberMethods *long_methods = PyLong_Type.tp_as_number; in float_as_integer_ratio_impl()
/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()
/external/python/cpython3/Include/cpython/
Dabstract.h270 ((obj)->ob_type->tp_as_number != NULL && \
271 (obj)->ob_type->tp_as_number->nb_index != NULL)
Dobject.h194 PyNumberMethods *tp_as_number; member
/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/compiler/xla/python/
Dbfloat16.cc222 return PyArray_Type.tp_as_number->nb_add(a, b); in PyBfloat16_Add()
230 return PyArray_Type.tp_as_number->nb_subtract(a, b); in PyBfloat16_Subtract()
238 return PyArray_Type.tp_as_number->nb_multiply(a, b); in PyBfloat16_Multiply()
247 return PyArray_Type.tp_as_number->nb_divide(a, b); in PyBfloat16_TrueDivide()
249 return PyArray_Type.tp_as_number->nb_true_divide(a, b); in PyBfloat16_TrueDivide()
/external/python/cpython3/Modules/
D_randommodule.c278 n = PyLong_Type.tp_as_number->nb_absolute(arg); in random_seed()
/external/python/pybind11/include/pybind11/
Dcast.h1141 else if (auto tp_as_number = src.ptr()->ob_type->tp_as_number) {
1142 if (PYBIND11_NB_BOOL(tp_as_number)) {
1143 res = (*PYBIND11_NB_BOOL(tp_as_number))(src.ptr());
/external/python/pybind11/include/pybind11/detail/
Dclass.h592 type->tp_as_number = &heap_type->as_number; in make_new_python_type()
/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()

12