OKB (not okblacke) wrote:

A decorator basically modifies a function/method, so that ALL subsequent calls to it will behave differently.

Furthermore, usually a decorator is used when for some
reason you *can't* achieve the same effect with code
inside the function itself.

For example, the classmethod() and staticmethod()
decorators return descriptors that have different
magical effects from a standard function object when
looked up in a class or instance. Since that magic
happens *before* the function is called, you can't
do the same thing using an ordinary function.

In this case, an ordinary function is quite sufficient,
and there is no need to involve a decorator.

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to