[Python-Dev] method decorators (PEP 318)

Kevin Jacobs jacobs at theopalgroup.com
Fri Mar 26 18:25:26 EST 2004


Guido van Rossum wrote:

>[Walter Doerwald]
>  
>
>>For me '@' looks like something that the compiler shouldn't see.
>>    
>>
>
>I don't understand.  Why?  Is that what @ means in other languages?
>Not in JDK 1.5 -- the compiler definitely sees it.
>  
>

Gack!  @ is ugly as sin to me.  Why not allow function attributes as 
keyword arguments
using the decorator syntax.  e.g.,

  def foo(self, a) [classmethod, precondition=predicate1, 
postcondition=predicate2,
                                             bnf= 'FOO := left op right']:
     pass


Thoughts?

-Kevin




More information about the Python-Dev mailing list