Are decorators really that different from metaclasses...

David Eppstein eppstein at ics.uci.edu
Sun Aug 29 16:58:38 EDT 2004


In article <mailman.2580.1093800655.5135.python-list at python.org>,
 Paul Morrow <pm_mon at yahoo.com> wrote:

> Anthony Baxter wrote:
> > On Sun, 29 Aug 2004 12:10:13 -0400, Paul Morrow <pm_mon at yahoo.com> wrote:
> > 
> >>For example, in the following function def, the comments specify (what I
> >>believe is) the author's intention behind each assignment.
> >>
> >>    def circu(diameter):
> >>       """Info about circu."""        # defines circu.__doc__
> >>       __author__ = 'Paul Morrow'     # defines circu.__author__
> >>       __features__ = memoized        # defines circu.__features__
> >>       pi = 3.14                      # local variable definition
> >>       return pi * diameter
> > 
> > 
> > Not in any Python I know of. I look at that and I think "oo, local 
> > variables". 
> > 
> > That you have a different belief doesn't make it right - I remain
> > _extremely_ unconvinced.
> > 
> > Anthony
> 
> My belief doesn't make it right, that's true.  But I think that a 
> preponderance of supporting evidence does.
> 
> Have you seen a significant number of cases where a function uses 
> __xxx__ attributes as local variables?  Have you seen any?

So we really need to return to the FORTRAN days where variables have 
different semantics depending on their first character?
Anyway, regardless of whether it's a local variable or an attribute, if 
it's in the function body I expect it to be executed at call time not 
def time.

-- 
David Eppstein
Computer Science Dept., Univ. of California, Irvine
http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list