On 3/11/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 3/11/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > > I've another idea. Date and datetime objects are compared by date. The > > date object for a given date is always smaller than the datetime for the > > same day - even for midnight. > > I really don't understand what the problem is with having a date() > behave like a proper temporal interval. The only person complaining > about that interpretation acknowledged that for his purposes, it would > be better than the status quo. And I have yet to see a use case where > being consistent with temporal interval logic is a problem.
I do not really understand proper temporal intervals. But I am interested what "temporal interval logic" has to say about this problem: def get_most_recent_articles(articles, cutoff_date): recent_articles = [] for article in articles: if article.datetime_posted > cutoff_date: recent_articles.append(article) return recent_articles Would temporal interval logic make it so an article with datetime(2007, 1, 1, 0, 0, 0) be included, if cutoff_date was date(2007, 1, 1)? What about articles with datetimes (2007, 1, 1, 0, 0, 1) and (2007, 1, 2, 0, 0, 0) respectively? I believe that "temporal interval logic" has to include at least the last two examples in recent_articles, otherwise it would be highly annoying. -- mvh Björn _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com