Hacker News new | ask | show | jobs
by kodablah 814 days ago
They didn't have to be dunder methods though, they could have used any other naming scheme (e.g. just `__` at the beginning, EDIT: or something else) and remained just as important in the ecosystem.
1 comments

Double leading underscore has a special meaning and causes the name to be mangled in order to avoid collisions with other classes e.g. `__foo` -> `_ClassName_foo`

https://peps.python.org/pep-0008/#descriptive-naming-styles