PEP 318: Can't we all just get along?

Paul Morrow pm_mon at yahoo.com
Thu Aug 19 09:33:35 EDT 2004


Anthony Baxter wrote:

> On Thu, 19 Aug 2004 06:35:18 -0400, Paul Morrow <pm_mon at yahoo.com> wrote:
> 
>>Unless of course you want a method to be private/semi-private.  How do
>>you feel about the way we can create/manipulate lists and dictionaries
>>using special (magical) syntax?  Why is that different (acceptable)?
> 
> 
> Look, name-mangling is horrid, and I don't think anyone's defending it. But
> at the same time, "name mangling is there" is not an argument for extending
> the horror to a whole new level. 
> 

I disagree.  It's an effective name-hiding technique.  Simple + 
Effective = Good.


> Name mangling only occurs when you create a method with two leading
> underscores, and no trailing ones. Your proposal would hit _every_ _single_
> 'def'. It's nasty, it's unpythonic, and there's approximately _zero_ chance of
> it ever going into the language. Having said that, it's perfectly feasible to do
> it with a metaclass, and if you want to use it in your code, please, feel free.
> 

It's not unpythonic, if by that you mean that it's unlike other python 
formalisms.  And it would *only* hit those defs that were attributes of 
classes derived from a new Object (capital 'O') class.





More information about the Python-list mailing list