Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'only,': 0.07; 'subject:string': 0.09; 'subject:python': 0.11; '>>>': 0.14; 'to:name:python-list@python.org': 0.14; 'denotes': 0.16; 'expression,': 0.16; 'expression.': 0.16; 'forbid': 0.16; 'from:addr:lanyjie': 0.16; 'from:name:yingjie lan': 0.16; 'nesting': 0.16; 'received:124.205': 0.16; 'reply- to:addr:lanyjie': 0.16; 'reply-to:name:yingjie lan': 0.16; 'yingjie': 0.16; '(the': 0.16; 'string': 0.19; 'example': 0.19; 'header:In-Reply-To:1': 0.22; 'that.': 0.24; "haven't": 0.24; 'cheers,': 0.26; 'preceding': 0.28; 'subject:skip:i 10': 0.28; 'reply-to:addr:yahoo.com': 0.28; "i'm": 0.29; 'embedded': 0.30; 'really': 0.33; 'something': 0.34; 'to:addr:python-list': 0.35; 'done': 0.35; 'things': 0.35; 'should': 0.35; 'there': 0.36; 'dynamic': 0.37; 'subject:: ': 0.37; 'to:addr:python.org': 0.39; 'where': 0.39; 'issue': 0.40; 'skip:$ 10': 0.62; 'first': 0.62; 'offer': 0.63; 'final': 0.64; 'header:Reply-To:1': 0.67; 'is\xa0': 0.84; 'peter,': 0.84; 'received:98.138.90.53': 0.91 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 685475.34498.bm@omp1026.mail.ne1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1333382542; bh=SoDSC6ilBrE4xyy+3Yr3uBEeHjK9+W2xGtwPGA85P0c=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=6g+ikZhWydU1QagIX3O/5EprswBPv4V89qSr0b90iOeKp54eoHWlBUA9MSKLYzcLsj+35bxB4TSidZ8UYmmXpB9GkH9+3nHPeCvIKWG4mpP4+UHjOpQVuzEX0xxhdw1sqnaAj3XMBBv8iDVY6fHMl9XyiAlBr+GCeYanUcXwwwQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=fvohaVbrnxDyF9g011tVBVVlY9ZPVjHyeSg47KnWon5mQS3nG/UDe3Jc0PiyzbHiST4uItETd0miuWu8Uo6/6H0NUTPOB6wEryfM7/hx8Px1x745732eMOg3qWu8YSjfA4Mb1rs3PZ/j3wGN+eOd0jCWyceT0QvLe8l0tCY6J7w=; X-YMail-OSG: X8RuTIkVM1kiYwvuteJDk3.OmLe31QC7YqrraPNM9GjSuXt lw_MG0eXW805SY215wdvA7HmA7ycv7IKPFsLK2tte1LsaUknAG4ArsCWTol_ 5EiGsqgR8tK8fIQA9g1V3wRxljN2f9QUc5BZyvzDzzuAccPpXyaoOofJgTuC 0.of4UGIDIheln5h3rZGGPocPEtso_dJkJTiCwLqWZ5D_zdzgHrXjmFRM2me _.xex9AKKMZxLJOvq1CeKn.cneUVcWDtc3FdmT9WsiQXFH.SAuAoRl1yTkXE 7stgxZYLF._tSk_WdTkkY5lWT.21qMGZYfZiCu1sHH8DnC.KADzHv0BlvTwb So4AcukmXvvbJ4VUeo_ma8ynO6guo.eshiCocl5g0X8oHNr9IrdQsI1sWb5. _JwUCWWuYNtduXpPRFbp9zNKoH4onvTa.eLtxf5LIKDlEfNucPzXBWJ202LT n3D.4xPQHwXfGbSO9S08z0Vc- X-Mailer: YahooMailWebService/0.8.117.340979 References: <1333174946.18436.YahooMailNeo@web121506.mail.ne1.yahoo.com> <4f7962b0$0$29981$c3e8da3$5496439d@news.astraweb.com> <4f79938c$0$29981$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 2 Apr 2012 09:02:22 -0700 (PDT) From: Yingjie Lan Subject: Re: string interpolation for python To: "python-list@python.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Yingjie Lan 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1333382551 news.xs4all.nl 6913 [2001:888:2000:d::a6]:44003 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22476 >> =A0 In that case you should re-think the delimiters, so that you have=0A= =0A>> =A0 something=0A>> that can be nested.=A0 An example (example only, = I'm not in love with it =0A> as=0A>> a final form):=0A=0AHaven't really th= ought about that. Nesting is a big=A0=0Aissue if=A0in the embedded expressi= on, there is another=A0=0Adynamic string expression. For example (the first= =0A'%' immediately preceding the first quote denotes=0Athe start of a dynam= ic string expression)::=0A=0A>>> first_name, family_name =3D "Peter", "John= s"=0A>>> %"Hi $ first_name+%", $family_name$" $!"=0A=0A'Hi Peter, Johns!'= =0A=0AHowever, nesting is really cluttering things up and=0Awe should forbi= d it without loosing power:=0AThe above example can be done without nesting= :=0A>>>=A0>>> %"Hi $ first_name$, $family_name$!"=0A'Hi Peter, Johns!'=0A= =0ACan you offer an example where nesting is=A0=0Abetter or necessary?=0A= =0ACheers,=0AYingjie