Hassan Abouelela <abouelelahas...@gmail.com> added the comment:

> "How long is it until Christmas?" the answer should be different if I ask on 
> one minute past midnight on December 24 or one minute to midnight.

No disagreement there, but that doesn't change based on having the current 
precise time (the current implementation) vs the start of the current day (my 
recommendation), especially if you are just calculating the difference in days. 
In both cases, running it one minute before midnight would return the 23rd, 
running it one minute after would return the 24th.

The only difference between both is that a direct subtraction from the 
beginning of the day, with the current implementation, would result in 
one-point-something days, instead of one day. If that is the case, what is the 
point of having datetime.today? It should be, like the original issue 
suggested, phased out.

The benefit doesn't lie there, rather it lies in having direct access to 
date.today in a datetime format, so you can perform math on it with datetime 
objects. This, in my opinion, would be more consistent with other languages, 
and more importantly would make datetime.today logical, as it would be 
date.today in datetime form, instead of datetime.now.

> many (maybe a majority) of uses of datetime.today are conceptually better as 
> date.today, but not all of them.

In what cases would having the current time be better? Should those cases 
instead use datetime.now for legibility?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41904>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to