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.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:help': 0.07; 'python': 0.09; 'fork': 0.09; 'def': 0.10; '2.7': 0.13; 'dog': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'why,': 0.16; 'wed,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'feb': 0.19; 'sorry,': 0.22; "i've": 0.23; 'header:In-Reply-To:1': 0.25; 'wondering': 0.26; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'cat': 0.29; "d'aprano": 0.29; 'steven': 0.29; 'strings,': 0.29; 'writes:': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; "i'm": 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'self': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; '20,': 0.65; 'subject:Data': 0.65; '2013': 0.84; 'leo': 0.84; 'otten': 0.84; 'pear': 0.84; 'do:': 0.91; 'mind...': 0.91; 'subject:urgent': 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; bh=oHBtV6J9djZFRbO7F73KAGDm6fZB9xFHaofRs9gN5FQ=; b=RUlMe/YLDzvYv6T1E5btsmgGdSgyzHXgs76U7ceJjsh8ubgBvcMphNa+dghbRy2icS 1Vmcj18ZNBK4BxWDAccJLnUqsVMHb3U2Obqa+1aKRNX3kHehA7ACGZeq2aBgCIdcrwr6 Lm1D5JBYdAipyFngbZ7lz4cIqiv/Byh2vIlrgNYUqt/QbVe0+HqQQQamH9HQ7cgCxsJ0 Ic/zrhNxMIUl3bdDyl/simvbAvGRKYhv62Euo4+bUzBuaXeCRLnHciDvxrb7kEhc+J5h cJhQS7xupd6P4Myulmvu4PIFwm33KiypeyAqkm5Py5SksIlD2A1CqOCykic25FWxS2hb WOuQ== MIME-Version: 1.0 X-Received: by 10.220.150.136 with SMTP id y8mr24833158vcv.34.1361358995609; Wed, 20 Feb 2013 03:16:35 -0800 (PST) In-Reply-To: <5124ad18$0$29975$c3e8da3$5496439d@news.astraweb.com> References: <4abbe91f-a57e-47de-9cf3-5b9574201c83@googlegroups.com> <5124ad18$0$29975$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 20 Feb 2013 22:16:35 +1100 Subject: Re: Data Tree urgent help!!!!!! From: Chris Angelico To: python-list@python.org 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361359003 news.xs4all.nl 6987 [2001:888:2000:d::a6]:57437 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39346 On Wed, Feb 20, 2013 at 10:01 PM, Steven D'Aprano wrote: > Leo Breebaart wrote: > >> Peter Otten <__peter__@web.de> writes: >> >>> >>> class Name(str): >>> ... def __repr__(self): >>> ... return self >>> ... >>> >>> apple, pear, dog, cat, fork, spoon = map(Name, "apple pear dog cat >>> >>> fork spoon".split()) >> >> Is there any reason why you introduced the Name class? In Python >> 2.7 this works equally well if I just do: >> >>>>> apple, pear, dog, cat, fork, spoon = map(str, "apple pear dog cat fork >>>>> spoon".split()) >> >> So I was wondering why you used Name. > > I'm wondering why you used map. > > > apple, pear, dog, cat, fork, spoon = "apple pear dog cat fork spoon".split() Why, in case someone monkeypatched split() to return something other than strings, of course! Sorry, I've been learning Ruby this week, and I fear it may be damaging to my mind... ChrisA