Are decorators really that different from metaclasses...

Paul Morrow pm_mon at yahoo.com
Tue Aug 31 09:25:43 EDT 2004


Paul Morrow wrote:
> 
> But why speculate.  Let's see if this is really going to be unclear in 
> practice.  Ask someone who has never seen Python before which are the 
> local variables in the following def.
> 
>    def circumference(diameter):
>       """Calculate the diameter of a circle."""
>       __author__ = 'Paul Morrow'
>       __version__ = '0.1'
>       pi = 3.14
>       return pi * diameter
> 
> 

And while you're at it, ask them which lines get executed at function 
definition time, and which get executed when the function is called.

Paul




More information about the Python-list mailing list