18834, "aconsroe-hpe", "'DateTime' module stabilization - removing ambiguous functions", "2021-12-09T23:24:59Z"
As part of the DateTime
module review, we identified two functions that seem ambiguous and eligible for deprecation and ultimately removing. They are:
-
datetime.today
- This function refers totoday
for adatetime
, where thetime
portion is ambiguous what the user desires.- Suggested to replace uses with
datetime.now
ordate.today
- Suggested to replace uses with
-
operator datetime.-(dt: datetime, d: date):timedelta
- thedate
gets promoted todatetime
with time00:00:00
.- Suggested to replace uses with
dt.date - d
ordt - new datetime(d, new time())
(with a newdatetime
init overload)
- Suggested to replace uses with