55 karma · joined Mar 19, 2015 (11y ago) · 9 submissions
comment 2y ago · link · parent
> modern datetime libraries … in other languages choose to not represent these 'missing' local times.
Another edge case with throwing errors over gap times is eventually a region’s dst policies may change. So what used to be valid can now be invalid (and vice versa). Updating the library must be done with an audit of existing data, or suffer loud unexpected failures.
Thanks for taking the time to address this critic. Easier to be a critic than a creator after all.
comment 2y ago · link · parent
# This time doesn't exist on this date
d = datetime(2023, 3, 26, 2, 30, tzinfo=paris)
# No timestamp exists, so it just makes one up
t = d.timestamp()
datetime.fromtimestamp(t) == d # False
Criticisms:1) The example would fail just as well for any datetime with given tzinfo. Because fromtimestamp returns native datetimes.
2) The timestamp isn't just "made up". Its behaviour is clearly documented in PEP 495, as linked by the author [0]. In this case it consistently corresponds to datetime(2023, 3, 26, 3, 30, tzinfo=paris).
[0] https://peps.python.org/pep-0495/
Finally if we disallow creating non-existent datetimes in the proposed library, how do we represent the 2am in "clock changes forwards at 2am"? Use 3am? There are tradeoffs.
comment 7y ago · link · parent
This is just my limited understanding of the rather inconsistent marketing copy. There is also a section about using a blockchain for DJs which I will not even try to comprehend on a weekend.