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
* Stephen J. Turnbull wrote:
> Chris Angelico writes:
> > On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin
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 her
Chris Angelico writes:
> On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin 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
On Thu, Aug 1, 2013 at 12:58 PM, Alexander Shorin wrote:
> Hi Steven,
>
> On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano
> 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 w
On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin 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, key=fun), key=fun
Hi Steven,
On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano 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
>> statem
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