On Wed, Aug 19, 2015 at 12:53 PM, Guido van Rossum <[email protected]> wrote:
> On Wed, Aug 19, 2015 at 9:15 AM, Alexander Belopolsky < > [email protected]> wrote: > >> On Wed, Aug 19, 2015 at 11:55 AM, Guido van Rossum <[email protected]> >> wrote: >> >>[...] >> > That does not sound like what I was proposing (as a hack) -- it simply >> > exchanges one bug for another. >> >> No, it is not a bug. >> > > That's a ridiculously narrow point of view. > > Well, >>> print(lt) 2015-03-07 12:00:00-05:00 >>> print(lt + timedelta(1)) 2015-03-08 12:00:00-05:00 Is as much a bug as >>> sum([0.1] * 10) == 1 False The code works exactly as designed and documented. The fact that it can be used to write buggy programs does not mean that there is a bug in the library. The same library can be used to write correct programs and I have shown how. I don't see what is so "narrow" in my point of view. Can you elaborate? Regardless of the software involved, if I give you an ISO 8601 string "2015-03-07 12:00:00-0500" and ask you: What time will be 24 hours after that? I bet your answer will be "2015-03-08 12:00:00-0500." And I don't think you will appreciate being ridiculed for not knowing that the "correct" answer is "2015-03-08 13:00:00-0400." After all, Python does not really care: >>> fmt = "%Y-%m-%d %H:%M:%S%z" >>> datetime.strptime("2015-03-08 13:00:00-0400", fmt) == datetime.strptime("2015-03-08 12:00:00-0500", fmt) True
_______________________________________________ Datetime-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/datetime-sig The PSF Code of Conduct applies to this mailing list: https://www.python.org/psf/codeofconduct/
