Can decorator syntax do this ? (annotated results' names)

Christopher T King squirrel at WPI.EDU
Thu Aug 5 10:06:39 EDT 2004


On Thu, 5 Aug 2004, Sakesun Roykiattisak wrote:

> I stopped follow decorator-syntax discussion for a while, because it 
> seems everlasting.
> But now look like it's settle, so I wonder how far can I go with this 
> new feature ?

Oh, you don't know how wrong you are ;)  All Guido's allowance of the @
syntax into 2.4a2 did was reignite debate, with no end in sight (unless he
pushes it through to 2.4 final, something I sincerely hope he doesn't).  
If I were you, I'd hold off on using decorators until they're in a stable
branch, since there's a good chance they might disappear in 2.4a3.

To answer your question, decorators allow for pretty much anything you can 
define a function to do; the code in your example will work, provided you 
provide a suitable definition for resultnames(): it must return a function 
that accepts a function and returns a (mangled version of that) function.  




More information about the Python-list mailing list