[Python-ideas] Please reconsider the Boolean evaluation of midnight

Chris Angelico rosuav at gmail.com
Fri Mar 7 05:43:26 CET 2014


On Fri, Mar 7, 2014 at 1:12 PM, Greg <greg.ewing at canterbury.ac.nz> wrote:
> On 7/03/2014 1:13 p.m., Chris Angelico wrote:
>>
>> What operations can you do on a time-of-day-with-timezone? Give me
>> some examples, and I'll show you, with the above two examples, how
>> quirky that can be.
>
>
> I'm not particularly attached to the idea of times of day with
> timezones; I wouldn't mind if they didn't exist.
>
> The main point is that they definitely don't make sense for
> time differences. An hour in New York is the same length as
> an hour in Melbourne, on any day of the year, as far as I know.

Sure. So a timedelta with timezone makes no sense. But we're not
talking about timedelta here, we're talking about time.

(And we're also ostriching leap seconds away. Don't wanna know! Don't
wanna know!)

A calendar that supports repeating events is going to need some kind
of rule system anyway. I don't think a "time with timezone" is
sufficient for that. I haven't used that kind of system (ever!), but
from Lennart Regebro's PyCon 2013 talk "Blame it on Caesar", I gather
that there is such a thing in Python.

So... from this thread, it seems like there's only one real use for
time-with-timezone: fracturing a datetime-with-timezone into two
parts, date and time, and recombining losslessly. Anyone have other
uses?

ChrisA


More information about the Python-ideas mailing list