Hacker News new | ask | show | jobs
by sametmax 2586 days ago
Datetime is a good module if you don't deal with timezones, which is most of the time. And it doesn't come with out of the box support for timd zones, so either you code it, or you use a third party lib.

Hence we don't discourage people from using datetime, it's in the stdlib, and it's useful.

However, if you need time zones, either you code something yourself, in that case you are supposed to know what you are doing, or you look up the best libs for the job.

For the last part, no language have a perfect answer. It's an organic process. I've never met any tool solving it, not even intellij.

2 comments

I had no idea pendulum existed, is there some way I should have looked it up? None of the code in tz-aware packages I've ever read used it, for example.
Looking up is not a solved problem no.

I usually check the "awesome python list", ask on reddit and twitter, and then do some google foo. I select 3 packages and do some tests.

I got nothing better than that.

Another good source is find talks at recent PyCon or PyData conferences that survey that topic, then pick the packages they recommend.
Good summary. I think one of the unspoken concerns is with the "look up the best libs for the job" step. How do we ensure that the up-to-date information is easily found in that lookup? Stack Overflow is a huge search sink for stuff like this, and has never taken the deprecation/evolution problem very seriously.

Maybe not in this exact case of dateutils vs. pendulum, but it's really easy to find outdated information on the web and struggle to confirm whether it's still the best answer.