Why less emphasis on private data?

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Jan 7 12:57:54 CET 2007


On 07 Jan 2007 02:01:44 -0800, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
> >       __ (two leading underscores) results in name-mangling. This /may/ be
> > used to specify "private" data, but is really more useful when one is
> > designing with multiple super classes:
>
> Trouble with this is you can have two classes with the same name,
> perhaps because they were defined in different modules, and then the
> name mangling fails to tell them apart.

What is the chance of having to inherit from two classes from
different modules but with exactly the same name *and* the same
instance variable name?

Of course you're being very pessimistic or extremely unlucky.

-- 
Felipe.



More information about the Python-list mailing list