[Python-Dev] PEP 340 - possible new name for block-statement

Aahz aahz at pythoncraft.com
Sat Apr 30 00:43:00 CEST 2005


On Fri, Apr 29, 2005, Phillip J. Eby wrote:
>
> Actually, I've just realized that I was misled by your argument into 
> thinking that the possibility of confusing a multi-line call and a block of 
> this sort is a problem.  It's not, because template blocks can be viewed as 
> multi-line calls that just happen to include a block of code as one of the 
> arguments.   So, mistaking one for the other when you're just skimming the 
> code and not looking at things like "as" or the ":", is really not 
> important.

Maybe.  I'm not persuaded, but this inclines me toward agreeing with
your position.

> In the second place, the most important cue to understanding the behavior 
> of a template block is the template function itself; the bare syntax gives 
> it the most prominence.  Blocks like 'synchronized(self):' should be 
> instantly comprehensible to Java programmers, for example, and 'retry(3):' 
> is also pretty self-explanatory.  And so far, template function names and 
> signatures have been quite brief as well.

This works IMO IFF Python is regarded as a language with user-defined
syntactical structures.  Guido has historically disagreed strongly with
that philosophy; until and unless he reverses his opinion, this is
precisely why the non-keyword version will continue to receive -1 from
me.  (As it happens, I agree with Guido, so if Guido wants to change,
I'll probably argue until I see good reason. ;-)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It's 106 miles to Chicago.  We have a full tank of gas, a half-pack of
cigarettes, it's dark, and we're wearing sunglasses."  "Hit it."


More information about the Python-Dev mailing list