Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:[ 20': 0.03; 'nested': 0.07; 'python': 0.09; 'cc:addr:python-list': 0.10; '-tkc': 0.16; 'correctly,': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'relates': 0.16; 'sequence.': 0.16; 'situation.': 0.16; 'do.': 0.21; 'cc:2**0': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'skip:[ 10': 0.26; '(as': 0.27; "doesn't": 0.28; 'depth': 0.29; 'definition': 0.29; 'implement': 0.32; 'cases,': 0.33; 'function.': 0.33; 'another': 0.33; 'agree': 0.34; 'needed': 0.35; 'sequence': 0.35; 'should': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'received:50.22': 0.84; 'received:108': 0.91; 'reducing': 0.95 Date: Sun, 10 Feb 2013 18:12:57 -0600 From: Tim Chase To: Rick Johnson Subject: Re: LangWart: Method congestion from mutate multiplicty In-Reply-To: <6b7d7299-7ce3-401f-a950-04cea18af399@googlegroups.com> References: <680e50a4-6569-49cf-b369-0be450545d50@googlegroups.com> <5115c455$0$6574$c3e8da3$5496439d@news.astraweb.com> <511784b3$0$29988$c3e8da3$5496439d@news.astraweb.com> <6b7d7299-7ce3-401f-a950-04cea18af399@googlegroups.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: python-list@python.org 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360541491 news.xs4all.nl 6911 [2001:888:2000:d::a6]:53434 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38620 > > > flatten, flattened > > > > flatten is another often requested, hard to implement correctly, > > function. The only reason that Python doesn't have a flatten is > > that nobody can agree on precisely what it should do. > > Steven, the definition of flatten (as relates to sequences) is > very, VERY simple: > > Return a new sequence that is the result of reducing > a nested sequence of sequences into a single depth > sequence. What should you get if you flatten [[[1,2],[3,4]],[[5,6],[7,8]]] Should the result be [[1,2],[3,4],[5,6],[7,8]] or [1,2,3,4,5,6,7,8] I've needed both cases, depending on the situation. -tkc