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

Guido van Rossum gvanrossum at gmail.com
Sat Apr 30 01:02:16 CEST 2005


[Phillip]
> > 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.

[Aahz]
> 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. ;-)

Actually, I think this is a nice way to have my cake and eat it too:
on the one hand, there still isn't any user-defined syntax, because
the keyword-less block syntax is still fixed by the compiler. On the
other hand, people are free to *think* of it as introducing syntax if
it helps them understand the code better. Just as you can think of
each distinct @decorator as a separate piece of syntax that modifies a
function/method definition. And just as you can think of a function
call as a user-defined language extension.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list