Lines Matching refs:result
57 * final result fits in a C int (this can be an issue on 64-bit boxes).
191 PyObject *result;
197 result = PyTuple_GET_ITEM(temp, 0);
198 Py_INCREF(result);
201 return result;
226 /* Cast year to unsigned. The result is the same either way, but
627 /* Fiddle out-of-bounds months and days so that the result makes some kind
739 /* Parse the date components of the result of date.isoformat()
970 PyObject *result;
973 result = new_date_ex(year, month, day, (PyTypeObject *)cls);
976 result = new_datetime_ex(year, month, day, 0, 0, 0, 0, Py_None,
980 result = PyObject_CallFunction(cls, "iii", year, month, day);
983 return result;
1228 * and the caller must not decref the result.
1243 /* Call getattr(tzinfo, name)(tzinfoarg), and check the result. tzinfo must
1248 * this returns NULL. Else result is returned.
1289 * result. tzinfo must be an instance of the tzinfo class. If utcoffset()
1303 * result. tzinfo must be an instance of the tzinfo class. If dst()
1316 /* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be
1319 * returns NULL. If the result is a string, we ensure it is a Unicode
1325 PyObject *result;
1335 result = _PyObject_CallMethodIdOneArg(tzinfo, &PyId_tzname, tzinfoarg);
1337 if (result == NULL || result == Py_None)
1338 return result;
1340 if (!PyUnicode_Check(result)) {
1343 Py_TYPE(result)->tp_name);
1344 Py_DECREF(result);
1345 result = NULL;
1348 return result;
1578 PyObject *result = NULL; /* guilty until proved innocent */
1727 result = _PyObject_CallMethodIdObjArgs(time, &PyId_strftime,
1738 return result;
1746 /* Call time.time() and return its result (a Python float). */
1750 PyObject *result = NULL;
1756 result = _PyObject_CallMethodIdNoArgs(time, &PyId_time);
1759 return result;
1769 PyObject *result;
1790 result = _PyObject_CallMethodIdOneArg(time, &PyId_struct_time, args);
1793 return result;
1800 /* The comparisons here all most naturally compute a cmp()-like result.
1801 * This little helper turns that into a bool result for rich comparisons.
1852 PyObject *result = NULL;
1885 result = PyNumber_Add(x1, x2);
1886 assert(result == NULL || PyLong_CheckExact(result));
1892 return result;
1898 PyObject *result = PyNumber_Divmod(a, b);
1899 if (result != NULL) {
1900 if (!PyTuple_Check(result)) {
1903 Py_TYPE(result)->tp_name);
1904 Py_DECREF(result);
1907 if (PyTuple_GET_SIZE(result) != 2) {
1910 PyTuple_GET_SIZE(result));
1911 Py_DECREF(result);
1915 return result;
1929 PyObject *result = NULL;
1971 result = new_delta_ex(d, s, us, 0, type);
1976 return result;
1992 PyObject *result;
2003 result = microseconds_to_delta(pyus_out);
2005 return result;
2039 PyObject *result = NULL;
2059 result = microseconds_to_delta(pyus_out);
2065 return result;
2073 PyObject *result;
2084 result = microseconds_to_delta(pyus_out);
2086 return result;
2094 PyObject *result;
2106 result = PyNumber_FloorDivide(pyus_left, pyus_right);
2109 return result;
2117 PyObject *result;
2129 result = PyNumber_TrueDivide(pyus_left, pyus_right);
2132 return result;
2138 PyObject *result;
2147 result = microseconds_to_delta(pyus_out);
2150 return result;
2156 PyObject *result = Py_NotImplemented;
2167 result = new_delta(days, seconds, microseconds, 1);
2170 if (result == Py_NotImplemented)
2171 Py_INCREF(result);
2172 return result;
2199 PyObject *result;
2205 result = delta_negative(self);
2207 result = delta_positive(self);
2209 return result;
2215 PyObject *result = Py_NotImplemented;
2226 result = new_delta(days, seconds, microseconds, 1);
2229 if (result == Py_NotImplemented)
2230 Py_INCREF(result);
2231 return result;
2277 PyObject *result = Py_NotImplemented;
2282 result = multiply_int_timedelta(right,
2285 result = multiply_truedivide_timedelta_float(
2289 result = multiply_int_timedelta(left,
2292 result = multiply_truedivide_timedelta_float(
2295 if (result == Py_NotImplemented)
2296 Py_INCREF(result);
2297 return result;
2303 PyObject *result = Py_NotImplemented;
2308 result = divide_timedelta_int(
2312 result = divide_timedelta_timedelta(
2317 if (result == Py_NotImplemented)
2318 Py_INCREF(result);
2319 return result;
2325 PyObject *result = Py_NotImplemented;
2329 result = truedivide_timedelta_timedelta(
2333 result = multiply_truedivide_timedelta_float(
2336 result = truedivide_timedelta_int(
2340 if (result == Py_NotImplemented)
2341 Py_INCREF(result);
2342 return result;
2387 PyObject *result;
2413 result = PyTuple_Pack(2, PyTuple_GET_ITEM(divmod, 0), delta);
2416 return result;
2423 * numerically careful way, and that's the result. Any fractional
2976 PyObject *result;
2989 result = _PyObject_CallMethodIdOneArg(cls, &PyId_fromtimestamp, time);
2991 return result;
3022 PyObject *result = NULL;
3025 result = date_fromtimestamp(cls, timestamp);
3028 return result;
3037 PyObject *result = NULL;
3050 result = new_date_subclass_ex(year, month, day, cls);
3053 return result;
3151 PyObject *result = NULL;
3159 result = new_date_subclass_ex(year, month, day,
3161 return result;
3256 PyObject *result;
3269 result = wrap_strftime((PyObject *)self, format, tuple,
3272 return result;
3302 "The result of date.isocalendar() or datetime.isocalendar()\n\n\
3736 PyObject *result = NULL;
3756 "utcoffset() result required");
3765 "dst() result required");
3772 result = add_datetime_timedelta((PyDateTime_DateTime *)dt, delta, 1);
3773 if (result == NULL)
3777 dst = call_dst(GET_DT_TZINFO(dt), result);
3783 Py_SETREF(result, add_datetime_timedelta((PyDateTime_DateTime *)result,
3785 if (result == NULL)
3791 return result;
3802 Py_XDECREF(result);
4177 PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
4178 Py_INCREF(result);
4179 return result;
4343 PyObject *result = NULL;
4346 result = PyUnicode_FromFormat("%s(%d, %d, %d, %d)",
4349 result = PyUnicode_FromFormat("%s(%d, %d, %d)",
4352 result = PyUnicode_FromFormat("%s(%d, %d)", type_name, h, m);
4353 if (result != NULL && HASTZINFO(self))
4354 result = append_keyword_tzinfo(result, self->tzinfo);
4355 if (result != NULL && fold)
4356 result = append_keyword_fold(result, fold);
4357 return result;
4372 PyObject *result;
4413 result = PyUnicode_FromFormat(specs[given_spec][1],
4418 if (result == NULL || !HASTZINFO(self) || self->tzinfo == Py_None)
4419 return result;
4424 Py_DECREF(result);
4427 PyUnicode_AppendAndDel(&result, PyUnicode_FromString(buf));
4428 return result;
4434 PyObject *result;
4456 result = wrap_strftime((PyObject *)self, format, tuple,
4459 return result;
4469 PyObject *result = NULL;
4498 result = diff_to_bool(diff, op);
4518 result = diff_to_bool(diff, op);
4521 result = Py_False;
4522 Py_INCREF(result);
4525 result = Py_True;
4526 Py_INCREF(result);
4536 return result;
4696 PyObject *result = NULL;
4705 result = PyTuple_Pack(1, basestate);
4707 result = PyTuple_Pack(2, basestate, self->tzinfo);
4710 return result;
4852 PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
4853 Py_INCREF(result);
4854 return result;
5059 * 0 and max_fold_seconds will result in an identical
5211 PyObject *result = NULL;
5214 result = datetime_from_timestamp(cls, _PyTime_gmtime, timestamp,
5216 return result;
5247 PyObject *result = NULL;
5258 result = new_datetime_subclass_fold_ex(GET_YEAR(date),
5269 return result;
5285 // The result of this, if not NULL, returns a new reference
5561 /* factor must be 1 (to add) or -1 (to subtract). The result inherits
5616 PyObject *result = Py_NotImplemented;
5677 result = new_delta(delta_d, delta_s, delta_us, 1);
5678 if (result == NULL)
5682 Py_SETREF(result, delta_subtract(result, offdiff));
5688 result = add_datetime_timedelta(
5695 if (result == Py_NotImplemented)
5696 Py_INCREF(result);
5697 return result;
5752 PyObject *result = NULL;
5792 result = PyUnicode_FromFormat(specs[given_spec][1],
5799 if (!result || !HASTZINFO(self))
5800 return result;
5805 Py_DECREF(result);
5808 PyUnicode_AppendAndDel(&result, PyUnicode_FromString(buffer));
5809 return result;
5842 PyObject *result, *flip_dt;
5847 result = datetime_utcoffset(flip_dt, NULL);
5849 return result;
5854 * on the value of its fold attribute, the result is False.
5862 int result = 0;
5871 result = 1;
5881 result = 1;
5884 return result;
5890 PyObject *result = NULL;
5941 result = diff_to_bool(diff, op);
5963 result = diff_to_bool(diff, op);
5966 result = Py_False;
5967 Py_INCREF(result);
5970 result = Py_True;
5971 Py_INCREF(result);
5981 return result;
6087 PyObject *result = NULL;
6139 result = new_timezone(delta, nameo);
6143 return result;
6201 PyDateTime_DateTime *result;
6247 /* result = self - offset */
6248 result = (PyDateTime_DateTime *)add_datetime_timedelta(self,
6251 if (result == NULL)
6254 /* Make sure result is aware and UTC. */
6255 if (!HASTZINFO(result)) {
6256 temp = (PyObject *)result;
6257 result = (PyDateTime_DateTime *)
6258 new_datetime_ex2(GET_YEAR(result),
6259 GET_MONTH(result),
6260 GET_DAY(result),
6261 DATE_GET_HOUR(result),
6262 DATE_GET_MINUTE(result),
6263 DATE_GET_SECOND(result),
6264 DATE_GET_MICROSECOND(result),
6266 DATE_GET_FOLD(result),
6267 Py_TYPE(result));
6269 if (result == NULL)
6274 temp = result->tzinfo;
6275 result->tzinfo = PyDateTime_TimeZone_UTC;
6276 Py_INCREF(result->tzinfo);
6281 temp = result->tzinfo;
6283 tzinfo = local_timezone(result);
6285 Py_DECREF(result);
6291 result->tzinfo = tzinfo;
6294 temp = (PyObject *)result;
6295 result = (PyDateTime_DateTime *)
6299 return result;
6380 PyObject *result;
6387 result = delta_total_seconds(delta, NULL);
6401 result = PyFloat_FromDouble(seconds - EPOCH_SECONDS +
6404 return result;
6489 PyObject *result = NULL;
6498 result = PyTuple_Pack(1, basestate);
6500 result = PyTuple_Pack(2, basestate, self->tzinfo);
6503 return result;
7006 but that takes a bit of proof. We first prove a stronger result. What's the
7066 would have to change the result dst() returns: we start in DST, and moving
7077 UTC hours 5:MM and 6:MM to 1:MM Eastern. The result is ambiguous