[issue3249] bug adding datetime.timedelta to datetime.date

Amaury Forgeot d'Arc report at bugs.python.org
Thu Jul 3 13:44:31 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

To be valid, your analogy between dates and numbers suggests that a date
should be convertible to the datetime with the same date, at midnight.
And both objects compare equal, just like 42==42.0

But today this is not the case: it's hard to convert a date into a
datetime, and types cannot be ordered:
>>> datetime.date.today() < datetime.datetime.now()
TypeError: can't compare datetime.datetime to datetime.date

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3249>
_______________________________________


More information about the Python-bugs-list mailing list