Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Dates That Don't Exist (yossarian.net)
1 point by woodruffw on May 15, 2018 | hide | past | favorite | 1 comment


That is, the demonstrated behavior of Python is exactly what the documentation claims will happen.

I believe the author is misrepresenting the documentation by writing:

> Python's datetime module, despite claiming to represent a date object in "the current Gregorian calendar," sadly does not do so:

This is an incomplete quote from the Python documentation. The full context is (emphasis mine):

> A date object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions.

The Python documentation in the same paragraph says:

> This matches the definition of the “proleptic Gregorian” calendar in Dershowitz and Reingold’s book Calendrical Calculations, where it’s the base calendar for all computations.

Elsewhere it says that the datetime represents: "An idealized naive date, assuming the current Gregorian calendar always was, and always will be, in effect."

P.S. The article is dated (2015).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: