PEP 318 - Function Modifier Syntax

W Isaac Carroll icarroll at pobox.com
Tue Jun 10 04:37:43 EDT 2003


Erik Max Francis wrote:
> Kevin Smith wrote:
> 
> 
>>        def foo(self) as synchronized(lock), classmethod:
>>            """ Gerrit Holl syntax """
>>            perform method operation
> 
> 
> I strongly prefer this syntax, still from the first time it got brought
> up and I commented on it.

For what it's worth, I prefer this syntax also. The only concern I have 
is possible confusion about the meaning of "as". In an import statement, 
it gives the name that's actually being bound to the imported object. In 
this proposed syntax, it doesn't affect the bound name but instead 
changes the semantics. Hopefully that won't be a problem.

TTFN






More information about the Python-list mailing list