Comment

Comment by TomBombadildoze

No, it is bad advice, and it is absolutely not idiomatic Python. The language specification reserves them to ensure new ones can be added in the future.

https://docs.python.org/3/reference/lexical_analysis.html#re...

This has been in the specification since, at latest, Python 2.0, and perhaps earlier.

Any you see defined outside the Python data model are entirely historical, written in contradiction to the spec. Many of them also can't be changed because there is so much code in the wild that depends on them.

*Do not define your own dunder methods!*

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton