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

Roy Smith roy at panix.com
Thu Aug 19 10:28:07 EDT 2004


Anthony Baxter wrote:
> > 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. 

Paul Morrow <pm_mon at yahoo.com> wrote:
> I disagree.  It's an effective name-hiding technique.  Simple + 
> Effective = Good.

I disagree with your disagreement :-)

I find a mix of text and puctuation difficult to read.  Human brains 
don't read letters, they read whole words.  That's why, for example, 
it's so easy to make a typo and not notice it.  I find "word.word" easy 
to parse, but "word.__word" much more difficult.  I don't know if it's 
the switching back and forth between letters and symbols, or the 
juxtaposition of the two symbols down on the baseline (i.e. ".__") that 
makes it hard to read.

This is true of the __name__ convention for internal names too, but 
somehow I don't find that as bad.  Maybe because it's symmetric?  Maybe 
because my brain recognizes the whole __name__ as a unit, with the 
"name" part of it being what I really recognize?

Even worse is when mix them.  Stuff like "__myPrivateFunc.__name__" is 
total gibberish to me.

Oh my god, I just realized (Ob decorator comment here) that if we start 
having people write private decorators, we'll have things like:

@__decorator

which really makes me barf.



More information about the Python-list mailing list