[Datetime-SIG] Calendar vs timespan calculations...
lrekucki at gmail.com
Sun Aug 2 19:32:58 CEST 2015
On Sunday, August 2, 2015, Alexander Belopolsky <
alexander.belopolsky at gmail.com
> On Sun, Aug 2, 2015 at 9:46 AM, Guido van Rossum <guido at python.org> wrote:
> > There's a simpler reason for ignoring leap seconds in datetime: Python's
> > wall clock is mappable to POSIX timestamps, which also ignore leap
> > (the reason being Tim's long explanation :-).
> Note that if you combine several recently made proposals, you can have
> a fully backward-compatible solution for leap seconds.
I don't have much time to respond now, but please don't add leap seconds.
People are actively working to get rid of them entirely and they are never
useful on the business level which this module is aimed at.
> You can
> simply use time(23, 59, ss, us, first=False) to stand for times in the
> 23:60 minute and delegate arithmetics to the tzinfo object:
> def __add__(self, delta):
> add = self.tzinfo.add
> except AttributeError:
> # current logic
> return add(self, delta)
> Same for `__sub__` and possibly `strftime`, `isoformat`, etc. if you
> want time(23, 59, ss, us, first=False) to be printed as 23:60:ss.us.
> Note that Olson database contains information about leap seconds, so
> once you have access to that and a way to spell 23:60 (as the repeated
> 23:59!) you can easily implement "correct" UTC timezone.
> On the other hand, I would like to proceed in baby steps. Let's
> first implement the means to disambiguate repeated times and various
> improvements that it will allow to the existing datetime
> functionality. Meanwhile the developers of timezone libraries will
> hopefully embrace the new feature and improve their offerings.
> Hopefully, by the time we are ready to distribute a full TZ database
> with Python, the problem of distribution will be solved by IETF .
> If their solution (as expected) includes leap second information, we
> can find a way to give Python users access to it in one way or
> : https://tools.ietf.org/html/draft-ietf-tzdist-service-11
> Datetime-SIG mailing list
> Datetime-SIG at python.org
> The PSF Code of Conduct applies to this mailing list:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Datetime-SIG