A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-March/071830.html below:

[Python-Dev] datetime module enhancements

[Python-Dev] datetime module enhancements [Python-Dev] datetime module enhancementsJon Ribbens jon+python-dev at unequivocal.co.uk
Sat Mar 10 14:29:09 CET 2007
Christian Heimes <lists at cheimes.de> wrote:
> > What do you feel "next Tuesday plus 12 hours" means? ;-)
> 
> First thought: It's nonsense! Nobody would say that. ;)
> 
> Second though: Tuesday noon (12h after the beginning of Tuesday)

I agree with you entirely. Your suggestions correspond to 'throw an
exception' and 'return a datetime'. Note that in the second case you
are agreeing with me that a date means midnight at the start of that
date ;-)

Python datetime disagrees with us both. It basically says 'add the
timedelta to midnight at the start of the date, then return just
the date part of the result'.

I assume there is some reason for this surprising behaviour. But this
is another example of where datetime is taking a pragmatic approach in
an ambiguous situation - exactly as I am suggesting in the situation
of comparing a date and a datetime.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4