◐ Shell
clean mode source ↗

Message 58068 - Python tracker

timedelta.todays() could be useful in general I suppose.  I think
timedelta.toweeks() could be omitted since it's simple division by an
easy to recognize constant...also the timedelta docs say that it stores
data in terms of microseconds, seconds, and days.

OTOH tohours(), tominutes(), etc. (all the units that the constructor
uses) could be useful in some cases.

My feeling is that adding a method for each time unit bloats the API too
much.  Personally I've only ever wanted to know the number of seconds a
timedelta represents. It seems like seconds are a good base unit to
support since it allows easier interoperability with other python types
and external data.