Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotBM to Hacker NewsEnglish · 1 month ago

Why Pendulum had to write the most cursed "+" operator in all of Python

dev.arie.bovenberg.net

external-link
message-square
0
link
fedilink
1
external-link

Why Pendulum had to write the most cursed "+" operator in all of Python

dev.arie.bovenberg.net

RSS BotBM to Hacker NewsEnglish · 1 month ago
message-square
0
link
fedilink
Why Pendulum had to write the most cursed + operator in all of Python
dev.arie.bovenberg.net
external-link
Pendulum is a popular Python library for working with datetimes. Its + operator is unusual, even for a datetime library: when you add a timedelta to a Pendulum DateTime, it consults the call stack to decide which answer to give you. What? And why? The hack itself is on its way out, but the design behind it still matters for your code.

Comments

alert-triangle
You must log in or register to comment.

Hacker News

hackernews

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !hackernews@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

NOTICE: The bot occasionally has downtime, sorry about that. I’m working on adding better monitoring and error recovery so I can get notified faster.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Source of the RSS Bot.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 419 users / day
  • 2.1K users / week
  • 4.14K users / month
  • 8.83K users / 6 months
  • 2 local subscribers
  • 5.8K subscribers
  • 65.5K Posts
  • 36.1K Comments
  • Modlog
  • mods:
  • patrick
  • RSS BotB
  • BE: 0.19.21
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org