[Python-Dev] PEP 8 modernisation

R. David Murray rdmurray at bitdance.com
Thu Aug 1 17:07:48 CEST 2013

On Thu, 01 Aug 2013 16:53:16 +0200, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> On 1 Aug, 2013, at 16:48, Alexander Shorin <kxepal at gmail.com> wrote:
> > 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 be solved with assigning lambda to some name,
> > but now they are looks useless (or useful only for very trivial cases)
> That sounds about right :-)

I don't understand the cases being mentioned in the question, but there
are certainly places where lambdas are useful.  The most obvious is as
arguments to functions that expect functions as arguments.

But yes, even in those cases if a lambda isn't fairly trivial, it
probably shouldn't be a lambda.


More information about the Python-Dev mailing list