3 ms·
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 remain
by kodablah 3y 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.
- enragedcacti 3y agoDouble 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 https://peps.python.org/pep-0008/#descriptive-naming-styles