Path: csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '3),': 0.09; '[1,': 0.09; 'agree,': 0.09; "'a',": 0.16; '(2,': 0.16; '3],': 0.16; '[none,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subtype': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'expanded': 0.17; 'feb': 0.19; 'define': 0.20; 'tuples': 0.22; 'example': 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'behavior.': 0.29; 'johnson': 0.32; '11,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'should': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'think': 0.40; 'your': 0.60; 'more': 0.63; 'behavior': 0.64; '2013': 0.84; 'everything.': 0.84; 'rick': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=0wZa8z9hwMVaDMRprPQ7kbw1piGbIBQz51kguCft3qI=; b=JoIOQZtlryBZLCBMtYLGNMIwPXQK7ByVRAfhI/cUG+FCGjJYdfysB/bbJgtSg4M2Ro Ah2ZYloeQFjZff0qu+igU5d0tZ3zcWWxu1Q42pDmHNjHlrbs/xLvSeJDi6i9qT3Rj7sd xHExXcwLNIWcX56PvONzoTPbMXMGZFqlqnII75U4MRaubOYicwTLSrVqDWEgCcVwCmI0 FzAGZOPK/uDo5KxIGF0pCkSqRhySblC8YYc2cOdFPCOAapBhOg/XcPGJnwj0WZ25Ssof p/U1sWnD8DUGcaNGA37/mB2qovLlEXPxmOxAELXOME8HtI2BgPrf4LZjDniEQPRuGvVX H67Q== MIME-Version: 1.0 X-Received: by 10.52.37.109 with SMTP id x13mr16469320vdj.10.1360589250683; Mon, 11 Feb 2013 05:27:30 -0800 (PST) In-Reply-To: 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> <51183d05$0$29992$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 12 Feb 2013 00:27:30 +1100 Subject: Re: LangWart: Method congestion from mutate multiplicty From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360589258 news.xs4all.nl 6845 [2001:888:2000:d::a6]:42327 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38679 On Mon, Feb 11, 2013 at 11:53 PM, Rick Johnson wrote: > Which primitive(s) should NOT have been expanded in your opinion? The "Po= int" object? I agree, that's why MY implementation would call seq.flatten()= on all sub-sequences THEREBY allowing each subtype to define it's own flat= ten behavior. Of course the default behavior of the SequenceBase#flatten wo= uld be to flatten everything. > > However, ImmutableSequence Types would not flatten. In your example ["spa= m", "ham"] would not be expanded to ['s', 'p', 'a', 'm', 'h', 'a', 'm']. ps= st: strings and tuples are immutable! So... flatten([None, 23, [1, 2, 3], (2, 3), ["spam", "ham"]]) would return [None, 23, 1, 2, 3, (2, 3), "spam", "ham"] ? I think that's even more unexpected. ChrisA