Lines Matching refs:result
93 PyObject *hint, *result;
116 result = _PyObject_CallNoArgs(hint);
118 if (result == NULL) {
126 else if (result == Py_NotImplemented) {
127 Py_DECREF(result);
130 if (!PyLong_Check(result)) {
132 Py_TYPE(result)->tp_name);
133 Py_DECREF(result);
136 res = PyLong_AsSsize_t(result);
137 Py_DECREF(result);
178 PyObject *meth, *result;
189 result = PyObject_CallOneArg(meth, key);
191 return result;
774 PyObject *result = NULL;
813 result = PyObject_CallOneArg(meth, format_spec);
816 if (result && !PyUnicode_Check(result)) {
819 Py_TYPE(result)->tp_name);
820 Py_DECREF(result);
821 result = NULL;
827 return result;
851 Order operations are tried until either a valid result or error:
932 PyObject *result = BINARY_OP1(v, w, op_slot, op_name);
933 if (result == Py_NotImplemented) {
934 Py_DECREF(result);
951 return result;
958 Order operations are tried until either a valid result or error:
1073 PyObject *result = BINARY_OP1(v, w, NB_SLOT(nb_add), "+");
1074 if (result != Py_NotImplemented) {
1075 return result;
1077 Py_DECREF(result);
1081 result = (*m->sq_concat)(v, w);
1082 assert(_Py_CheckSlotResult(v, "+", result != NULL));
1083 return result;
1111 PyObject *result = BINARY_OP1(v, w, NB_SLOT(nb_multiply), "*");
1112 if (result == Py_NotImplemented) {
1115 Py_DECREF(result);
1122 result = binop_type_error(v, w, "*");
1124 return result;
1170 result. No coercion is done on the arguments; the left-hand object
1215 PyObject *result = BINARY_IOP1(v, w, iop_slot, op_slot, op_name);
1216 if (result == Py_NotImplemented) {
1217 Py_DECREF(result);
1220 return result;
1261 PyObject *result = BINARY_IOP1(v, w, NB_SLOT(nb_inplace_add),
1263 if (result == Py_NotImplemented) {
1265 Py_DECREF(result);
1271 result = func(v, w);
1272 assert(_Py_CheckSlotResult(v, "+=", result != NULL));
1273 return result;
1276 result = binop_type_error(v, w, "+=");
1278 return result;
1284 PyObject *result = BINARY_IOP1(v, w, NB_SLOT(nb_inplace_multiply),
1286 if (result == Py_NotImplemented) {
1290 Py_DECREF(result);
1305 result = binop_type_error(v, w, "*=");
1307 return result;
1404 Raise TypeError if the result is not an int
1425 PyObject *result = Py_TYPE(item)->tp_as_number->nb_index(item);
1426 assert(_Py_CheckSlotResult(item, "__index__", result != NULL));
1427 if (!result || PyLong_CheckExact(result)) {
1428 return result;
1431 if (!PyLong_Check(result)) {
1434 Py_TYPE(result)->tp_name);
1435 Py_DECREF(result);
1438 /* Issue #17576: warn if 'result' not of exact type int. */
1443 Py_TYPE(result)->tp_name)) {
1444 Py_DECREF(result);
1447 return result;
1451 Raise TypeError if the result is not an int
1457 PyObject *result = _PyNumber_Index(item);
1458 if (result != NULL && !PyLong_CheckExact(result)) {
1459 Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
1461 return result;
1469 Py_ssize_t result;
1476 result = PyLong_AsSsize_t(value);
1477 if (result != -1)
1500 result = PY_SSIZE_T_MIN;
1502 result = PY_SSIZE_T_MAX;
1513 return result;
1520 PyObject *result;
1537 result = m->nb_int(o);
1538 assert(_Py_CheckSlotResult(o, "__int__", result != NULL));
1539 if (!result || PyLong_CheckExact(result)) {
1540 return result;
1543 if (!PyLong_Check(result)) {
1546 Py_TYPE(result)->tp_name);
1547 Py_DECREF(result);
1550 /* Issue #17576: warn if 'result' not of exact type int. */
1555 Py_TYPE(result)->tp_name)) {
1556 Py_DECREF(result);
1559 Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
1560 return result;
1572 result = _PyObject_CallNoArgs(trunc_func);
1574 if (result == NULL || PyLong_CheckExact(result)) {
1575 return result;
1577 if (PyLong_Check(result)) {
1578 Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
1579 return result;
1583 if (!PyIndex_Check(result)) {
1587 Py_TYPE(result)->tp_name);
1588 Py_DECREF(result);
1591 Py_SETREF(result, PyNumber_Index(result));
1592 return result;
1622 result = _PyLong_FromBytes(PyBytes_AS_STRING(bytes),
1626 return result;
1771 PyObject *result = BINARY_OP1(s, o, NB_SLOT(nb_add), "+");
1772 if (result != Py_NotImplemented)
1773 return result;
1774 Py_DECREF(result);
1797 PyObject *n, *result;
1801 result = BINARY_OP1(o, n, NB_SLOT(nb_multiply), "*");
1803 if (result != Py_NotImplemented)
1804 return result;
1805 Py_DECREF(result);
1830 PyObject *result = BINARY_IOP1(s, o, NB_SLOT(nb_inplace_add),
1832 if (result != Py_NotImplemented)
1833 return result;
1834 Py_DECREF(result);
1859 PyObject *n, *result;
1863 result = BINARY_IOP1(o, n, NB_SLOT(nb_inplace_multiply),
1866 if (result != Py_NotImplemented)
1867 return result;
1868 Py_DECREF(result);
2041 Py_ssize_t n; /* guess for result tuple size */
2042 PyObject *result = NULL;
2066 /* Guess result size and allocate space. */
2070 result = PyTuple_New(n);
2071 if (result == NULL)
2099 if (_PyTuple_Resize(&result, n) != 0) {
2104 PyTuple_SET_ITEM(result, j, item);
2109 _PyTuple_Resize(&result, j) != 0)
2113 return result;
2116 Py_XDECREF(result);
2124 PyObject *result; /* result list */
2131 result = PyList_New(0);
2132 if (result == NULL)
2135 rv = _PyList_Extend((PyListObject *)result, v);
2137 Py_DECREF(result);
2141 return result;
2282 Py_ssize_t result = _PySequence_IterSearch(seq, ob, PY_ITERSEARCH_CONTAINS);
2283 return Py_SAFE_DOWNCAST(result, Py_ssize_t, int);
2411 PyObject *it, *result, *meth_output;
2432 result = PySequence_List(it);
2434 return result;
2863 PyObject *result;
2864 result = (*Py_TYPE(iter)->tp_iternext)(iter);
2865 if (result == NULL) {
2873 return result;
2877 PyIter_Send(PyObject *iter, PyObject *arg, PyObject **result)
2880 assert(result != NULL);
2882 PySendResult res = Py_TYPE(iter)->tp_as_async->am_send(iter, arg, result);
2887 *result = Py_TYPE(iter)->tp_iternext(iter);
2890 *result = PyObject_CallMethodOneArg(iter, &_Py_ID(send), arg);
2892 if (*result != NULL) {
2895 if (_PyGen_FetchStopIterationValue(result) == 0) {