[Python-ideas] Name mangling removal ?

Tarek Ziadé ziade.tarek at gmail.com
Sun Feb 1 14:25:43 CET 2009

On Sun, Feb 1, 2009 at 1:56 PM, Jesse Noller <jnoller at gmail.com> wrote:
> I think though - there's would be a fair amount of outcry due to this
> from the userbase/people looking at the language. Some people simply
> want the ability to hide things within their modules/classes/etc from
> the external consumers - this makes sense if you approach things from
> the JWODT (Java way of doing things), privacy of internal
> methods/variables is "key" to a clean and stable API.

That's the first thing that surprised me when I started Python, since
I came from Delphi where private and protected attributes were a
religion back then,

> I think if you find enough support, a PEP would need to be written up
> for this - it's a large enough change that we could not make it
> lightly. Not to mention if done in a 3.1 or 3.2 it would break
> compatibility with the older 3.xx releases (ergo, we'd need
> deprecation warnings and so on).

Yes, I am just throwing this here and that's a big piece of work indeed.

If people are supporting this idea, maybe it can be suggested to Brett
for dicussion at the Python Language Summit,
(for the "'new features and future plans" part)


> Ultimately, I'm +1 on this but I'm wary of it too - it's a pretty big
> change and without some ability to lock down/hide a given
> method/variable or way of constructing "public interfaces" I think
> people in the community may be upset.

I would tend to think that properties are a good alternative for people
that want to protect from external consumers.


More information about the Python-ideas mailing list