[Python-ideas] [Python-Dev] datetime module enhancements

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 12 23:35:32 CET 2007


Jim Jewett wrote:

> It would be OK with me to raise an error (ValueError?) on "dt <= d" if
> "dt in d".   Others might feel differently, and prefer to always get
> the TypeError -- which is probably why dt<t doesn't already do the
> obvious thing.

Seems to me that given all the conflicting behaviours
peole want this to have in different circumstances,
refusing to compare dates and datetimes is the right
thing to do.

All the use cases I've seen here for comparing them
are easily accommodated by either extracting a date
from the datetime to compare with the other date,
or deriving a datetime from the date with whatever
default time part you want. EIBTI.

--
Greg



More information about the Python-ideas mailing list