harrismh777 <harrismh...@charter.net> writes:

> Seriously, these little one liners teach me more about the python
> language in less time than [...]

def f(x,n,w): return x if n==1 else\
    (lambda x0=f(x[::2],n/2,w[::2]),\
            x1=f(x[1::2],n/2,w[::2]): reduce(lambda a,b: a+b ,\
                                      zip(*[(x0[k]+w[k]*x1[k],\
                                             x0[k]-w[k]*x1[k])\
                                             for k in range(n/2)])))()

it was a joke of sort played on it.comp.lang.python

[thanks to marco (zip(*...))  and antonio (lambda with default
arguments)]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to