[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: map/filter/reduce/lambda opinions and background unscientific
From: Daniel_Schüle <uval () rz ! uni-karlsruhe ! de>
Date: 2005-07-06 22:42:28
Message-ID: dahn9s$apv$1 () news2 ! rz ! uni-karlsruhe ! de
[Download RAW message or body]
I think in some contextes map is more readable than [f() for i in S]
because it's more verbatim
Removing lamdba would be reduce readability of Python, I think here
for examble of code like
class App:
....
....
def drawLines(self, event):
from random import randint
r = lambda : randint(1, 100)
self.canvas.create_line(r(), r(), r(), r())
defining one extra function would only confuse and
self.canvas.create_line(r(1, 100), r(1, 100), r(1, 100), r(1, 100))
is not very nice to look at
and what about creating one liner factories like
from math import log10
log = lambda basis: lambda x: log10(x) / log10(basis)
log2 = log(2)
log2(2**10) -> 10.0
I would consider it as a great loss for Python
if lambda will disappear
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic