[Python-Dev] functions decorators in 2.4?

Brett Cannon bac at OCF.Berkeley.EDU
Sat Jun 19 01:19:14 EDT 2004


Martin Zarate wrote:

> Why not use the underused "as" keyword for decorators?
> 
> That is,
> 
> def foo(bar, baz) as StaticMethod:
> 
> It would be very handy for classes, as I've worked with custom class 
> structures (such as an overcomplicated interface-based structure that I was 
> experimenting with) that it would be useful for.
> 

I think Guido has said no more syntax ideas on this one.  It's either 
before the 'def', after the argument list, or like Java 1.5 .

> Are there plans to extend this to fully custom blocks and statements like in 
> Ruby?  Or will it only be for modified def and class statements?
> 

Since Python does not have blocks like Ruby this is a moot point at the 
moment.  If Python grows blocks like Ruby it can be determined then.  As 
it stands now it is only meant for functions and methods.

-Brett



More information about the Python-Dev mailing list