After Python 2.2, methods that received the class itself as an
argument were classified as class methods. They were then definable
with the classmethod() method.
class Class:
def method(cls)
...
method = classmethod(method)
By convention, the argument which holds the class is always the first
and is called
cls.
Once again, this is for illustration only. After a spirited discussion
on the Python language discussion group, a formal syntax has been
incorporated for these two methods, and it is called a decorator.
[Note: This code is for illustration only. As we are about to
see, this syntax has now changed. Of course, Python offers backward
compatability for a few versions, but you should use the new syntax,
not this.]