Why Pendulum had to write the most cursed "+" operator in all of Python
- Python 近 90 天出现 21 次
- 上一次:1 天前 · trunk/8161f9858a7c86698d59776ff0c75930f3423d1f: Move CI docker images off Python 3.10 (#199535)
发生了什么
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.
摘要按规则整理自下方来源原文