Hi Alexander,
On 02/08/13 00:48, Alexander Shorin wrote:
Hi Ronald,
I understand this, but I'm a bit confused about fate of lambdas with
such guideline since I see no more reasons to use them with p.9
statement: long lines, code duplicate, no mock and well tests etc. -
all these problems could
Hi Steven,
On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano st...@pearwood.info wrote:
Hi Alexander,
On 02/08/13 00:48, Alexander Shorin wrote:
Hi Ronald,
I understand this, but I'm a bit confused about fate of lambdas with
such guideline since I see no more reasons to use them with p.9
On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin kxe...@gmail.com wrote:
fun = lambda i: i[1]
for key, items in groupby(sorted(items, key=fun), key=fun):
print(key, ':', list(items))
I'd do a direct translation to def here:
def fun(i): return i[1]
for key, items in groupby(sorted(items,
On Thu, Aug 1, 2013 at 12:58 PM, Alexander Shorin kxe...@gmail.com wrote:
Hi Steven,
On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano st...@pearwood.info
wrote:
Hi Alexander,
On 02/08/13 00:48, Alexander Shorin wrote:
Hi Ronald,
I understand this, but I'm a bit confused about
Chris Angelico writes:
On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin kxe...@gmail.com wrote:
fun = lambda i: i[1]
for key, items in groupby(sorted(items, key=fun), key=fun):
print(key, ':', list(items))
I'd do a direct translation to def here:
def fun(i): return i[1]
* Stephen J. Turnbull wrote:
Chris Angelico writes:
On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin kxe...@gmail.com
wrote:
fun = lambda i: i[1]
for key, items in groupby(sorted(items, key=fun), key=fun):
print(key, ':', list(items))
I'd do a direct translation to def
Steven D'Aprano wrote:
Lambda is still useful for the reason lambda has always been useful: it is
an expression, not a statement, so you can embed it directly where needed.
are there some possibilities to change def to an expression? do I need to
wait 'till python9k?
yes, this brings to the