Class Friends

Andrew McNamara andrewm at object-craft.com.au
Fri Aug 27 21:11:29 EDT 2004


>Really, the double-under mangling is more about stopping a subclass
>from stomping on some internal detail of the base class. In general,
>though, I've found it to be a complete pain in the arse - there's been
>too many times where I've been using an external library and wanted to
>hook into the base class to fix something, and had to use the mangled
>name.

It's more useful when using Mixin classes - as you say, a subclass could
validly want to mess with the implementation of a base class, but a mixin
shouldn't need to touch the internals of another.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Python-list mailing list