News for hackers. Stuff that matters.
Re:Whenever – typed and DST-safe datetimes for Python by mvanbaak on Sunday April 13, 2025 @08:46AM (#43672393)
As others stated, there are many rough edges and footguns in the stdlib. BUT ... in my (and yours apparently) opinion, it's a matter of knowing those edges/guns, and work with them. Like you, I also prefer to create my own code around those instead of bringing in some library that brings in their own foot guns and possibly sub-dependencies and and and...
Re:Whenever – typed and DST-safe datetimes for Python by matsemann on Sunday April 13, 2025 @08:55AM (#43672452)
So your projects end up with their own "lib" of scattered time functions, possibly with new small bugs. I'd then rather have a proper well-tested and maintained library.
Re:Whenever – typed and DST-safe datetimes for Python by mvanbaak on Sunday April 13, 2025 @09:02AM (#43672503)
The "lib" one needs for date time functions is as good as non-existent.

But yeah, you will have to create tests for the codepath, instead of relying on the tests the library maintainers create.

Re:Whenever – typed and DST-safe datetimes for Python by scott_w on Sunday April 13, 2025 @10:07AM (#43672915)
Given the list of issues (most of which I had never heard of) that the library author describes with datetime, I think I trust his tests over the ones I’d write.

Given how many tests I see fail on 29th February at the companies I’ve been at, I don’t trust my colleagues’ tests either!

Re:Whenever – typed and DST-safe datetimes for Python by brookst on Sunday April 13, 2025 @10:19AM (#43673000)
In a previous job where we had complete hell with an internal datetime lib under ambiguous ownership, a colleague joked that the original authors had taken early retirement when they turned 2,147,483,647 years old.