Class Friends

Anthony Baxter anthonybaxter at gmail.com
Fri Aug 27 13:09:09 EDT 2004


On Fri, 27 Aug 2004 16:55:28 GMT, Jeremy Bowers <jerf at jerf.org> wrote:
> (Some people would use "self.__x", to get the psuedo-private name munging
> invoked. My call is if the "security" isn't perfect there isn't much
> point, as the language is already depending on the client programmer to
> behave. I think Java can get good security but C++ is already effectively
> as permissive as Python, it just makes the hoops harder.)

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.

I've considered a jihad to try and get uses of the double-under
mangling removed from the standard library. Maybe once 2.4 is out I'll
take this on.



More information about the Python-list mailing list