[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accumulator



At 11:09 AM -0700 5/23/02, Paul Prescod wrote:
>Pixel wrote:
>>  ...
>>  well, you didn't talk about "reduce". The main pb with list
>>  comprehensions is that they are limited to giving lists as a result.
>
>reduce is used roughly once in the 50,000 lines of code that are the
>Python standard library. It clearly is not pulling its weight. In a
>project I worked on with six different Python programmers, ranging in
>expertise from guru to newbie, nobody used it once.
>
>"reduce" may be the right thing for Lisp programmers but we have
>concrete proof that it is not the right thing for Python programmers.

That's evidence, not a proof.

...

>Anything that can be done with lambda can be done without it, because
>these two statements are equivalent:
>
>_ = lambda y: y
>
>def _(y):
>	...

I think you meant to type

_ = lambda y: ...

rather than

_ = lambda y: y

Also (without knowing a *thing* about python), the two "statements" 
are equivalent only if they are indeed both statements; can the "def" 
form appear anywhere a statement can?

reluctantly yours,

john clements