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. 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?
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
participants (3)
-
Brett Cannon -
Josiah Carlson -
Martin Zarate