Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: mwilson@the-wire.com Newsgroups: comp.lang.python Subject: Re: string interpolation for python Followup-To: comp.lang.python Date: Mon, 02 Apr 2012 10:46:28 -0400 Organization: A noiseless patient Spider Lines: 15 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Mon, 2 Apr 2012 14:46:29 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="4XkwyqorlOIcE9krWrwrng"; logging-data="24810"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zNXbt0gOAuYAZ4rXiMMWf" User-Agent: KNode/4.4.8 Cancel-Lock: sha1:7VfuzFCb6n8NsO1qbmuAffeaSG8= Xref: csiph.com comp.lang.python:22471 Yingjie Lan wrote: > Seems you miss understood my notion of dynamic string. > Dynamic strings are expressions in disguise: the things > in between $...$ are plain old expressions (with optional > formatting specifications). They are evaluated > as if they were outside the dynamic string. In that case you should re-think the delimiters, so that you have something that can be nested. An example (example only, I'm not in love with it as a final form): "A string that gets %(count*spacer%) in the middle" "A string that gets %(count*%(spacer%)%) in the middle" Mel.