Joel Goldstick <joel.goldst...@gmail.com> writes: > On Sun, Sep 29, 2013 at 11:28 AM, giacomo boffi <pec...@pascolo.net> wrote: > > Νίκος <nikos.gr...@gmail.com> writes: > > > IF it can also be written in one-line > > def f(x,n,w):return(lambda y=f(x[::2],n/2,w[::2]),z=f(x[1::2],n/2,w > [::2]):reduce(lambda x,y:x+y,zip(*[(y[k]+w[k]*z[k],y[k]-w[k]*z[k]) for k > in > range(n/2)])))()if n>1 else x > > I've been reading along and learning some really obscure coding > patterns.
well, the obscure patterns aren't mine, they were contributed by some it.comp.python regulars, to which credit is due if credit is due (please ask google groups for the individual contributions) > why? to show a recreational one liner from which Νίκος could learn something, one way or another -- X = f(x,n,[exp(-2*pi*1j*k/n) for k in range(n/2)]) -- https://mail.python.org/mailman/listinfo/python-list