[Tutor] class/type methods/functions

Kent Johnson kent37 at tds.net
Thu Oct 30 21:47:14 CET 2008


On Thu, Oct 30, 2008 at 4:09 PM, spir <denis.spir at free.fr> wrote:

> Well, would someone clarify the point about decorators? Rather the point of
> having both a built-in function (introduced in python 2.2, as I just read)
> and a "decorator" (2.4) for a single use of declaring a method
> not_to_be_bound_to_an_instance?

Decorators are the @ syntax, not the function. In otherwords,

@classmethod
def foo():
  ...

means, decorate the function foo using the function classmethod.

More details here:
http://personalpages.tds.net/~kent37/kk/00001.html

Kent


More information about the Tutor mailing list