[reportlab-users] diagonal ShadedRect and Clipping ?

Robin Becker reportlab-users@reportlab.com
Mon, 12 Aug 2002 09:07:04 +0100


In article <3D56A595.4C6C5FAE@rasselstein-hoesch.de>, Dirk Datzert
<dirk.datzert@tks-rasselstein.thyssenkrupp.com> writes
>Hi Robin,
>
>I had to change the lambda in centroid for me. The global function fn
>was not found in lambda. Don't know why fn in centroid is global ?
>
>def centroid(P):
>    '''compute average point of a set of points'''
>    fn = float(len(P))
>    return reduce(lambda x,y,fn=fn: (x[0]+y[0]/fn,x[1]+y[1]/fn),P,(0,0))
>
>Regards,
>Dirk
OK it must be because I use 2.2, before we had to use the lambda as
above
-- 
Robin Becker