reduce() function not found - Please help!

Okay, so I have tried figuring this our for myself, but to no avail - both the inset and the solidify scripts make use of the reduce() function, and it works in Blender 2.48 and Python 2.5.

However, I am now working with Blender 2.49 and python 2.6 - and both scripts stopped working (applying solidify on curved surfaces fails). This is a big problem for me, since I tend to use both a LOT. Of course, I could switch to 2.48, apply the functions, and so on, and so forth, but that’s a pain.

So: can anyone please explain to me why these two scripts stopped working? What’s the solution? It seems the reduce() function is no longer available.

Error message:
File “<string>”, line 1, in <module>
File “F:\download\Blender 3D Tut\py scripts uinbels\Inset.1.py”, line 281, in <module>
MeshCheck()
File “F:\download\Blender 3D Tut\py scripts uinbels\Inset.1.py”, line 265, in MeshCheck
BPyMesh.meshCalcNormals(me)
File “F:\download\Blender 3D Tut.blender\scripts\bpymodules\BPyMesh.py”, line 1078, in mesh
alcNormals
average_no= functools.reduce(lambda a,b: a+b, fnos, Vector())
AttributeError: ‘module’ object has no attribute ‘reduce’
bevel in 0.001077 sec

It seems to me you might be using an older version of the bundled blender module BPY_Mesh as in my version (2.49b) the line with reduce() does not use the functools module but the built-in function . And Inset.1.py runs fine. I suggest you upgrade to 2.49b or check why you could have a different version of BPY_Mesh.py than bundled with Blender.

Thanks, I downloaded 2.49b (scripts version at http://www.graphicall.org/builds/builds/showbuild.php?action=show&id=1116) and it works fine now. Another thing I noticed was an old system variable that pointed to 2.5, which I removed too.

Problem solved!