diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-02-08 03:28:59 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-02-08 03:28:59 (GMT) |
commit | aa7d849c7a915d6211c3dd004a038b7191c6b3fe (patch) | |
tree | 054d089dfda8580f3590b9caf360897d388d6f99 /Modules | |
parent | 9914227caa4f25b7442ea82cd6feab68821bb011 (diff) | |
download | cpython-aa7d849c7a915d6211c3dd004a038b7191c6b3fe.zip cpython-aa7d849c7a915d6211c3dd004a038b7191c6b3fe.tar.gz cpython-aa7d849c7a915d6211c3dd004a038b7191c6b3fe.tar.bz2 |
timedelta comparison and datetime addition: as the Python implementation
of datetime does, accept instances of subclasses too.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/datetimemodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index c8ef3ae..e514a54 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -1666,7 +1666,7 @@ delta_richcompare(PyDateTime_Delta *self, PyObject *other, int op) { int diff = 42; /* nonsense */ - if (PyDelta_CheckExact(other)) { + if (PyDelta_Check(other)) { diff = GET_TD_DAYS(self) - GET_TD_DAYS(other); if (diff == 0) { diff = GET_TD_SECONDS(self) - GET_TD_SECONDS(other); @@ -2299,7 +2299,7 @@ date_add(PyObject *left, PyObject *right) Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } - if (PyDate_CheckExact(left)) { + if (PyDate_Check(left)) { /* date + ??? */ if (PyDelta_Check(right)) /* date + delta */ @@ -2328,8 +2328,8 @@ date_subtract(PyObject *left, PyObject *right) Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } - if (PyDate_CheckExact(left)) { - if (PyDate_CheckExact(right)) { + if (PyDate_Check(left)) { + if (PyDate_Check(right)) { /* date - date */ int left_ord = ymd_to_ord(GET_YEAR(left), GET_MONTH(left), |