Mmastodon TechnologyTechnology first seen 12 h ago, last 12 h ago, peak #12
Pendulum's unusual Python '+' operator explained
Original: Why Pendulum had to write the most cursed "+" operator in all of Python https://dev.arie.bovenberg.net/blog/pendulum-cur
A new blog post explains why Pendulum, the popular Python library for handling dates and times, implements an unusually complicated '+' operator. The piece walks through the edge cases in datetime arithmetic that forced the library's developers to write code that looks strange at first glance but handles real-world time zone and daylight saving quirks correctly.
Why now: Developers are sharing a technical deep-dive into surprising internals of a widely used Python library.
Evidence
- Why Pendulum had to write the most cursed "+" operator in all of Python https://dev.arie.bovenberg.net/blog/pendulum-cursed-plus-operator/ # HackerNews # Tech # Python · hackernews@robot.villas · 3
API: https://socialmediatrends-api.osmike.com/v1/trends/1435701