decorators question

Fredrik Lundh fredrik at pythonware.com
Mon Dec 4 14:30:28 EST 2006


king kikapu wrote:

> Hmmm...ok...it calls the decorator but when ?? It (the runtime) loads
> the .py file and start to call every decorator

you seem to be missing that the interpreter *always* executes the code 
in a module to find out what it contains.  "def" and "class" are exe- 
cutable statement, not compiler directives.  and the decorators are 
simply called right after the corresponding "def" statement has been 
executed.

</F>




More information about the Python-list mailing list