spir wrote:
def powerN(n):
def f(x,n=n): # ugly ;-)
return x ** n
return f
Since nothing can change the value of n there after powerN
returns, there's no need for default argument abuse. You
can just write
def powerN(n):
def f(x):
return x ** n
return f
--
Greg