Possible PEP: Improve classmethod/staticmethod syntax
Bryan
belred1 at yahoo.com
Tue Jun 3 23:35:11 EDT 2003
> >The current way of declaring a method to be a class method or a static
> >method leaves much to be desired. While it is flexible in the sense
> >that new types of method modifiers can be created without any
> >syntactical backwards incompatibilities, it just isn't that user-
> >friendly (and, in turn, not Pythonic).
>
> No argument; Guido considers the current method experimental. The
> current front-runner for fixing this is to add function decorators:
>
> def myMethod(args) [staticmethod]:
> blah, blah, blah
>
> staticmethod would be a callable object that would return the
> replacement function object. This would allow chained decorators.
> --
i'm sorry, but i'm not following you. can you please explain to me what you
mean by staticmethod being a replacement function object? so, staticmethod
isn't a keyword here? i must be missing something here, because this seems
weird to me.
bryan
More information about the Python-list
mailing list