Revised PEP 318 - Function/Method Decorator Syntax
Erik Max Francis
max at alcyone.com
Tue Jun 10 17:59:01 EDT 2003
Chris Liechti wrote:
> what's with the [] syntax discussed here a week ago?
> it was something like:
>
> def foo(self) [synchronized(lock), classmethod]:
To me it says, "Hi, I'm a list!" when listness does not seem warranted.
Yes, we're talking about a sequence of properties, but the square
brackets just look wrong there to me.
> or merging with yours:
>
> def foo(self) as [synchronized(lock), classmethod]:
Doubling up the syntaxes seems unnecessary.
> i think the use of [] is quite logic. it's a _list_ of function
> decorators.
> and it helps readability, at least the variants should be listed as
> alternatives in the PEP.
It's a sequence. And, if you want to get technical, it's more likely to
be handled as a tuple internally, anyway.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ I'm spreading my wings and I fly / I'm still as the night
\__/ Chante Moore
More information about the Python-list
mailing list