[Python-Dev] datetime module enhancements (original) (raw)
Robert Brewer fumanchu at amor.org
Sat Mar 10 18:04:34 CET 2007
- Previous message: [Python-Dev] datetime module enhancements
- Next message: [Python-Dev] datetime module enhancements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 3/9/07, Collin Winter <collinw at gmail.com> wrote:
> On the subject of datetime enhancements, I came > across an SF patch (#1673403) the other day that > proposed making it possible to compare date and > datetime objects.
One solution that just occurred to me -- and that skirts the issue of choosing an interpretation -- is that, when comparing date and datetime objects, the datetime's .date() method is called and the result of that call is compared to the original date. That is, datetimeobj < dateobj is implicitly equivalent to datetimeobj.date() < dateobj Seems a ready-made use case for that method.
+1
...and it's a decision that can be made independently of how to add or subtract dates.
Robert Brewer System Architect Amor Ministries fumanchu at amor.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20070310/ad8fcef4/attachment.htm
- Previous message: [Python-Dev] datetime module enhancements
- Next message: [Python-Dev] datetime module enhancements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]