Issue 1079134: datetime changes missing from "Porting from 2.3 to 2.4" (original) (raw)
Issue1079134
Created on 2004-12-04 23:29 by sadrejeb, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg23541 - (view) | Author: Sadruddin Rejeb (sadrejeb) | Date: 2004-12-04 23:29 |
Since Python2.4, it's impossible to compare date and datetime when it was possible to do so in previous versions. I think this changed behaviour is missing from the "What's new in Python 2.4" documentation and should figure in the "porting from 2.3 to 2.4" section. | ||
msg23542 - (view) | Author: Tim Peters (tim.peters) * ![]() |
Date: 2004-12-05 02:45 |
Logged In: YES user_id=31435 The truth (which is more involved than your characterization) is in the NEWS file: """ SF bug #1028306: Trying to compare a ``datetime.date`` to a ``datetime.datetime`` mistakenly compared only the year, month and day. Now it acts like a mixed-type comparison: ``False`` for ``==``, ``True`` for ``!=``, and raises ``TypeError`` for other comparison operators. Because datetime is a subclass of date, comparing only the base class (date) members can still be done, if that's desired, by forcing using of the approprate date method; e.g., ``a_date.__eq__(a_datetime)`` is true if and only if the year, month and day members of ``a_date`` and ``a_datetime`` are equal. """ | ||
msg23543 - (view) | Author: A.M. Kuchling (akuchling) * ![]() |
Date: 2005-06-09 15:57 |
Logged In: YES user_id=11375 Change made to the CVS HEAD version of the document; it'll be backported to the 2.4 maintenance branch before any 2.4.2 release. Thanks for reporting this! |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:08 | admin | set | github: 41282 |
2004-12-04 23:29:22 | sadrejeb | create |