Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.szaf.org!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail From: giacomo boffi Newsgroups: comp.lang.python Subject: Re: Handling 3 operands in an expression without raising an exception Date: Sun, 29 Sep 2013 17:28:26 +0200 Organization: The Sun and the Rain. Lines: 8 Message-ID: <87eh87ir51.fsf@pascolo.net> References: NNTP-Posting-Host: ppp-144-7.21-151.libero.it Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-7 Content-Transfer-Encoding: 8bit X-Trace: virtdiesel.mng.cu.mi.it 1380468507 10017 151.21.7.144 (29 Sep 2013 15:28:27 GMT) X-Complaints-To: abuse@diesel.cu.mi.it NNTP-Posting-Date: Sun, 29 Sep 2013 15:28:27 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b32 (linux) Cancel-Lock: sha1:Bm9wEPeCBR9yydFKb0z0CHHulLk= Xref: csiph.com comp.lang.python:55021 Νίκος 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 -- anch'io la penso come me, ma -- SteO153, in IHC