Message158615
| Author |
vstinner |
| Recipients |
loewis, mark.dickinson, michael.foord, rye, vstinner |
| Date |
2012年04月18日.12:58:07 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334753888.3.0.257360506338.issue14613@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> time.time() can return None, or sometimes NaN
It is possible that it returns NaN, but it cannot return None. time.time() implementation of Python 2.7:
static PyObject *
time_time(PyObject *self, PyObject *unused)
{
double secs;
secs = floattime();
if (secs == 0.0) {
PyErr_SetFromErrno(PyExc_IOError);
return NULL;
}
return PyFloat_FromDouble(secs);
}
FYI I removed the (secs == 0.0) check in Python 3.3 (issue #14368, changeset 206c45f45236), it was a bug. time.time() *cannot* fail, it always return a float. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月18日 12:58:08 | vstinner | set | recipients:
+ vstinner, loewis, mark.dickinson, michael.foord, rye |
| 2012年04月18日 12:58:08 | vstinner | set | messageid: <1334753888.3.0.257360506338.issue14613@psf.upfronthosting.co.za> |
| 2012年04月18日 12:58:07 | vstinner | link | issue14613 messages |
| 2012年04月18日 12:58:07 | vstinner | create |
|