[Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements
In Zope 2.4.3 binary on Linux import operator reduce(operator.add,[0,1,2,3,4]) gives me Error Value: global name 'reduce' is not defined Is this a faq? Brad Clements,[EMAIL PROTECTED] (315)268-1000 http://www.murkworks.com (315)268-9812 Fax

Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Romain Slootmaekers
On Thu, 6 Dec 2001, Brad Clements wrote: In Zope 2.4.3 binary on Linux import operator reduce(operator.add,[0,1,2,3,4]) try _.reduce() gives me Error Value: global name 'reduce' is not defined this shkould be clear enough as a message. zope can't find the reduce function.

Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements
On 6 Dec 2001 at 16:12, Romain Slootmaekers wrote: reduce(operator.add,[0,1,2,3,4]) try _.reduce() This is in a Python Script, I'm not using the DTML namespace. Note that map() and filter() work without a problem, so why not reduce() ? this shkould be clear enough as a message.

Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Romain Slootmaekers
On Thu, 6 Dec 2001, Brad Clements wrote: On 6 Dec 2001 at 16:12, Romain Slootmaekers wrote: reduce(operator.add,[0,1,2,3,4]) try _.reduce() This is in a Python Script, I'm not using the DTML namespace. Note that map() and filter() work without a problem, so why not

Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Romain Slootmaekers
indeed. in lib/python/AccessControl/ZopeGuards.py the guarded_reduce isn't there those who are are: ['cmp', 'round', 'AttributeError', 'random', 'str', 'range', 'ArithmeticError', 'whrandom', 'unichr', 'list', 'FloatingPointError', 'getattr', 'hasattr', 'setattr', 'IndexError',

Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements
On 6 Dec 2001 at 16:57, Romain Slootmaekers wrote: In retrospect, I should have posted only 1 message instead of 3 :) And I should have submitted a patch to the collector instead of posting here. :-( Just not sure what is the right way to do this, here's my first pass: def