Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'read.': 0.03; 'say,': 0.05; 'subject:Python': 0.06; '[1,': 0.09; 'boring': 0.09; 'hacking,': 0.09; 'lawrence': 0.09; 'subject:language': 0.09; 'things,': 0.09; 'playful': 0.16; 'received:10.20.200': 0.16; 'received:charter.net': 0.16; 'reinvent': 0.16; 'subject: \n ': 0.16; 'using,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'subject:list': 0.30; 'code': 0.31; 'another': 0.32; 'programmers': 0.33; 'received:10.20': 0.33; 'subject: (': 0.35; 'subject:lists': 0.35; 'add': 0.35; 'received:10': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'easy': 0.60; 'simple,': 0.60; 'no.': 0.61; "you're": 0.61; 'real': 0.63; 'such': 0.63; 'more': 0.64; 'received:96': 0.65; 'subject:this': 0.83; 'lists:': 0.91 X-Authority-Analysis: v=2.0 cv=F7QP7ddN c=1 sm=1 a=EBsYl1X+Lq2xj3QUCo3MmA==:17 a=zewopLiEtFcA:10 a=FJ9iXZmiczAA:10 a=nDghuxUhq_wA:10 a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=p-33VUW9qRC5gC9F57kA:9 a=QEXdDO2ut3YA:10 a=EBsYl1X+Lq2xj3QUCo3MmA==:117 Date: Fri, 28 Mar 2014 17:23:51 -0500 From: Mark H Harris User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 Newsgroups: comp.lang.python To: python-list@python.org Subject: Re: Howto flaten a list of lists was (Explanation of this Python language feature) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: , Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396045444 news.xs4all.nl 2953 [2001:888:2000:d::a6]:41774 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69292 On 3/28/14 5:12 PM, Mark Lawrence wrote: >> >> No. This has to be a better way to flatten lists: >> >> >>> from functools import reduce >> >> >>> import operator as λ >> >> >>> reduce(λ.add, l) >> [1, 2, 3, 4, 5, 6, 7, 8, 9] >> > > Why reinvent yet another way of flattening lists, particulary one that > doesn't use the far more sensible:- { particularly } > > from operator import add > > As for the stupid symbol that you're using, real programmers don't give > a damn about such things, they prefer writing plain, simple, boring code > that is easy to read. :-)) as RMS would say, "playful hacking, dude, playful hacking..."