This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients belopolsky, cheryl.sabella, eric.smith, francismb, jbatista, joar, maker, martin.panter, p-ganssle, petri.lehtinen, r.david.murray, ronaldoussoren
Date 2019-04-14.00:33:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555201983.97.0.224866896153.issue17267@roundup.psfhosted.org>
In-reply-to
Content
A real use case that I have had was with a protocol to activate a device with a daily schedule. The protocol takes start and end hours and minutes of the day. To test the device by activating it over the next few minutes, my ideal way would have taken the current time (according to the device controller) as a “time” object, and added a couple of minutes using “timedelta”. In the end I think I made my protocol API accept both “time” and “timedelta" objects, because I found “timedelta” more flexible for calculations, but the “time” class more natural in other cases.

The start and end times are local times, and daylight saving could come into play, but in reality I won’t be testing the device at 3 a.m. on a Sunday morning. If I did care, I would have to add my own logic with knowledge of the date and daylight saving, to raise an exception.

I agree with Alexander about supporting the difference between two “time” instances. The result should be a non-negative “timedelta”, at least zero, and strictly less than 24 h.
History
Date User Action Args
2019-04-14 00:33:04martin.pantersetrecipients: + martin.panter, ronaldoussoren, belopolsky, eric.smith, r.david.murray, maker, petri.lehtinen, francismb, joar, jbatista, p-ganssle, cheryl.sabella
2019-04-14 00:33:03martin.pantersetmessageid: <1555201983.97.0.224866896153.issue17267@roundup.psfhosted.org>
2019-04-14 00:33:03martin.panterlinkissue17267 messages
2019-04-14 00:33:03martin.pantercreate