def index(self):

Fredrik Lundh fredrik at pythonware.com
Fri Dec 22 03:06:44 EST 2006


Marc 'BlackJack' Rintsch wrote:

> This depends on the definition of `expr`.  If `expr` includes the
> possibility of enclosing parenthesis then yes.  There are scenarios where
> you would need them.  For example if you use objects that overload
> operators to build a callable used as decorator:
> 
> @spam + eggs + viking
> def fn(...): ...

that's a SyntaxError.  the decorator syntax only allows for a dotted 
name, optionally followed by an argument list in parentheses.

</F>




More information about the Python-list mailing list