On Tue, Apr 5, 2011 at 6:09 AM, gb <g...@cabiate.it> wrote:
> 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

(Remind me how it is that Python code is more readable than line noise
or Perl code?)

What sort of parameters does this take? So far all I can figure out is
that n is an integer and x and w are sliceables, but I'm not sure
whether x and w should be strings or arrays.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to