Single underscore, double underscore, name mangling, and dunder methods
A single underscore is a convention for internal use, double underscore triggers name mangling in classes, and dunder names are reserved for language-defined behavior.
- Single underscore is social, not enforced
- Double underscore rewrites names to reduce accidental clashes
- Dunder names should not be invented casually
Single underscore, double underscore, name mangling, and dunder methods