[Python-Dev] decorators and 2.4

Anthony Baxter anthony at interlink.com.au
Tue Jun 22 11:14:54 EDT 2004


So here's the state of play with decorators and 2.4.

Guido is undecided on the syntax - he writes "I'm seriously
considering doing it Java-style", but adds that he is totally
swamped for the next two weeks. He finishes with:
"Feel free to suggest this as a project for an adventurous
python-dev'er though."

So, who's feeling adventurous? I'm convinced that this should go
into 2.4 if possible, and I don't think there's any _technical_
risks (as far as implementation goes), the only problem is the
syntax (and yes, that's a technical problem too, but you know
what I mean).

Channelling Guido, via his EP keynote
(http://www.python.org/doc/essays/ppt/euro2004/euro2004.ppt)
I'm assuming that "Java-style" is something like:

@staticmethod
def blah(args):
     body

@funcattrs(vegetable="blah", author="GvR")
def blah2(args):
     body

It's not clear to me how you'd specify multiple decorators this
way, perhaps Guido can give more details...

So, let the floodgates open. Remember, we _can_ change this any
time up until 2.4b1, if there's a decision that the chosen form
sucks. :-)


-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.



More information about the Python-Dev mailing list