Vladimir

37%
Flag icon
if you name an instance attribute in the form __mood (two leading underscores and zero or at most one trailing underscore), Python stores the name in the instance __dict__ prefixed with a leading underscore and the class name, so in the Dog class, __mood becomes _Dog__mood, and in Beagle it’s _Beagle__mood. This language feature goes by the lovely name of name mangling.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview