New use for __ names! (Re: Is there a pattern...)
Magnus L. Hetland
mlh at idt.ntnu.no
Sun Sep 5 11:21:04 EDT 1999
Greg Ewing <greg.ewing at compaq.com> writes:
> "Magnus L. Hetland" wrote:
> >
> > So I started to wonder - is there an intelligent design pattern that
> > addresses this problem, i.e. methods that should only be called from a
> > specific class or a specific set of objects or something?
>
> How's this for a sneaky hack which shamelessly misuses
> the "__" name mangling mechanism:
Yay! Cool!! :)))
Even though this is probably Evil(tm), it was exactly the kind of
thing I was looking for...
--
Magnus Making no sound / Yet smouldering with passion
Lie The firefly is still sadder / Than the moaning insect
Hetland : Minamoto Shigeyuki
More information about the Python-list
mailing list