Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69291

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
From Mark H Harris <harrismh777@gmail.com>
Newsgroups comp.lang.python
Subject Re: Howto flaten a list of lists was (Explanation of this Python language feature)
Date Fri, 28 Mar 2014 17:23:51 -0500
Organization Aioe.org NNTP Server
Lines 29
Message-ID <5335F677.20605@gmail.com> (permalink)
References <lh4r6h$sqr$1@speranza.aioe.org> <mailman.8676.1396044784.18130.python-list@python.org>
NNTP-Posting-Host +K+LVGHWjDoy/+unkid0vA.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.python:69291

Show key headers only | View raw


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..."



Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Howto flaten a list of lists was (Explanation of this Python language feature) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 16:56 -0500
  Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-28 22:12 +0000
    Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:23 -0500
      Re: Howto flaten a list of lists was (Explanation of this Python language feature) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 02:33 +0000
        Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 22:04 -0500
          Re: Howto flaten a list of lists was (Explanation of this Python language feature) Rustom Mody <rustompmody@gmail.com> - 2014-03-28 20:21 -0700
            Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-29 15:46 +0000
          Re: Howto flaten a list of lists was (Explanation of this Python language feature) Chris Angelico <rosuav@gmail.com> - 2014-03-29 14:21 +1100
            Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 22:39 -0500
    Re: Howto flaten a list of lists was (Explanation of this Python language feature) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:23 -0500
    Re: Howto flaten a list of lists was (Explanation of this Python language feature) mm0fmf <none@mailinator.com> - 2014-03-29 15:59 +0000

csiph-web