New statement proposal for Python

Remco Gerlich scarblac at pino.selwerd.nl
Sun Jun 17 06:21:15 EDT 2001


David LeBlanc <whisper at oz.nospamnet> wrote in comp.lang.python:
> In article <slrn9ijrog.8bp.philh at comuno.freeserve.co.uk>, 
> philh at comuno.freeserve.co.uk says...
> > I have no problem having cxonstants like this, e.g.
> > 
> >    programVersion = "0.2.7"
> > 
> > it seems to me that:
> > 
> >    alias programVersion: "0.2.7"
> > 
> > is no clearer, and is an extra something for a learner to have to learn.
> > Entities should not be multiplied unnecessarily!
> 
> I absolutely agree that entities shouldn't be multiplied unnecessisarily! 
> However your suggestion in fact does just that: there is nothing that 
> prevents one from reassigning to programVersion in some module you 
> import. Oops... The important difference is that you can't change the 
> replacement text of an alias once set: it's immutable.

But does that belong in *Python*? Where you can delete builtin functions,
add and remove methods to classes on the fly, change any imported module's
functions from the outside, change a class' parent classes, change an
instance's class... *Nothing* is restricted in Python. 

That's what the language is about. It comes from the view point that
programmers are mature individuals who can be held responsible for their own
actions. As for newbies, it teaches them that they have to think for
themselves, and that coding style guides (like ALL_CAPS for things you
shouldn't change, or starting a method name with _ if it shouldn't be called
from the outside) are Good Things. It's explicit, not only at the place
where the thing is defined, but also where it is used! Readable.

Adding a way to block rebinding of a name would be a horribly inconsistent
wart on the language.

> > When I hear that phrase, I reach for my gun. Go and use Pascal or
> > Eiffel if you're into bondage-and-discipline.
> 
> Oh god am I tempted... but i'll refrain.

Why? I really don't see how you could find Python usable. Please, if a
language has a philosophy almost totally opposite from yours, go find a
language that better suits your needs instead of starting a flamewar in
comp.lang.python trying to fundamentally change the language...

-- 
Remco Gerlich



More information about the Python-list mailing list