Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'guido': 0.05; 'subject:Python': 0.06; 'deprecated': 0.09; 'pep': 0.09; 'subject:language': 0.09; 'python': 0.11; '24,': 0.16; 'lambda': 0.16; 'loops': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.18; 'either.': 0.24; 'rid': 0.24; 'mon,': 0.24; 'suggested': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; "doesn't": 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'that.': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; "couldn't": 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; 'then,': 0.60; 'more': 0.64; 'capable': 0.67; 'mar': 0.68; 'anything.': 0.68; 'nobody': 0.68; 'subject:this': 0.83; '(according': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=iQ+pIfgUBT+w2iOtmIY/XU1i1j5xKQauxyWqHKeNRRQ=; b=X2J73g6QPk+U+Ms0jSmHc4VoY3l0pxfszdvBitN6hFi7I7fodPGQikFE+mKW/0TKp7 1EsrwdlaZZaefhQ1ck4oLgCthoNZTp1Ejo8Xn+h4Eqkm7RTLE6qakxwoOAwB6f7rc88t K+q1vx4r5jWW/llNKEVleHUpPAHrBfuXNS3Fq/QjTT/jw/XEHb46MVQ+S76GHtA+vZfY Wfb99ILPuN6xJxwfv34wzTiEyTHXZJ0mu+s4UL2yrN2qE+OAOPrWx7RNABIlWEbIFBEd pE+7shyJkjjh3SrY3yxTGhJWYKGYyTbjNOiYkA0qCx+UFYDHZQ415CnxYhoEPDmntoRy 1CHg== X-Received: by 10.66.171.76 with SMTP id as12mr73261408pac.52.1395681880181; Mon, 24 Mar 2014 10:24:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87bnwv2a5v.fsf@elektro.pacujo.net> References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <10101874-2995-4acd-9851-989603f052e3@googlegroups.com> <532d5bd9$0$29994$c3e8da3$5496439d@news.astraweb.com> <87bnwv2a5v.fsf@elektro.pacujo.net> From: Ian Kelly Date: Mon, 24 Mar 2014 11:24:00 -0600 Subject: Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395681883 news.xs4all.nl 2873 [2001:888:2000:d::a6]:38097 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68888 On Mon, Mar 24, 2014 at 3:55 AM, Marko Rauhamaa wrote: > Ian Kelly : > >> If lambda were going to be deprecated and removed then it already >> would have happened in Python 3, because Guido tried to do precisely >> that. I'm not sure what the reasons were for keeping it in the end >> (according to PEP 3099 it was because nobody suggested a suitable >> replacement), but if he couldn't get rid of it then, he never will. > > You never *need* (Python's) lambda for anything. Inner functions are > more capable and almost always more readable. It doesn't hurt to have > lambda, but I don't find any use for it, either. So what? One might say the same thing about comprehensions -- loops are more capable and almost always more readable.