[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with the other respondents. This ship has sailed. -- nosy: +rhettinger ___ Python tracker ___

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree that having some of datetime.now([tz]) functionality replicated in datetime.today() makes little sense. However, the presence of this method in datetime class is a consequence of datetime being a subclass of the date class. The latter was a

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Damian Yurzola
Damian Yurzola added the comment: Sorry I got my "current" wrong and I can't find the edit button Here again: > "How long is it until Christmas?" # Current implementation In [23]: datetime.datetime(2020, 12, 25) - datetime.datetime.today() Out[23]: datetime.timedelta(days=71, seconds=53018,

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Damian Yurzola
Damian Yurzola added the comment: It took me a while to collect my thoughts but here you go. Advanced users don't have a problem. They'll trade in date or datetime objects explicitly. The "proof" is I could not find any github repo with more than one start that'll call datetime.today().

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Hassan Abouelela
Hassan Abouelela 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

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Oct 14, 2020 at 12:45:55AM +, Damian Yurzola wrote: > And you also see people doing date math on datetime.date.today which > will result in different answers through out the day. Yes? Is this a problem? If I ask the question "How long is it

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Damian Yurzola
Damian Yurzola added the comment: I searched all of github and there seem to be ~350K entries for datetime.today I think this supports steven.daprano point against removal. I could not spot any major library in a quick cursory look. However I do see many calls that look a lot like they

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-13 Thread Hassan Abouelela
Hassan Abouelela added the comment: If having an arbitrary time returned from the function is an issue, why not use a fixed time, say 0 UTC, representing the start of the day. This would mean that datetime.today is date.today, with an (arguably) meaningless timestamp to make it a datetime

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Oct 01, 2020 at 04:37:28PM +, Damian Yurzola wrote: > I was inspired to file this bug after reading through a multiplicity > of bugs introduced by folks confused by the library's behavior. Are these public bug reports or private anecdotes? I'm

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Damian Yurzola
Damian Yurzola added the comment: Thanks for your prompt answer Steven. I was inspired to file this bug after reading through a multiplicity of bugs introduced by folks confused by the library's behavior. So there's good precedent. While granted, the documentation is explicit and the

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Even if I agreed that this method "makes no sense", and I don't, removing it would be gratuitous breakage. Why should we break potentially thousands of people's code who are happily using this method, merely because you say that people who use it have "the

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-01 Thread Damian Yurzola
New submission from Damian Yurzola : Last night I discovered we have datetime.datetime.today alongside datetime.datetime.now and datetime.date.today. - datetime.now - date.today Both make semantic sense. datetime.datetime.today returns a datetime, which make no semantic sense and causes