Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22412 > unrolled thread

Re: string interpolation for python

Started byChris Rebert <clp2@rebertia.com>
First post2012-03-31 00:51 -0700
Last post2012-03-31 00:51 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: string interpolation for python Chris Rebert <clp2@rebertia.com> - 2012-03-31 00:51 -0700

#22412 — Re: string interpolation for python

FromChris Rebert <clp2@rebertia.com>
Date2012-03-31 00:51 -0700
SubjectRe: string interpolation for python
Message-ID<mailman.1173.1333180312.3037.python-list@python.org>
On Fri, Mar 30, 2012 at 11:22 PM, Yingjie Lan <lanyjie@yahoo.com> wrote:
> Hi all,
>
> I'd really like to share this idea of string interpolation for formatting.
> Let's start with some code:
>
>>>> name = "Shrek"
>>>> print( "Hi, $name$!")
> Hi, Shrek!

Python already has *3* different built-in string
formatting/interpolation systems:
http://docs.python.org/library/string.html#template-strings
http://docs.python.org/library/string.html#format-string-syntax
http://docs.python.org/library/stdtypes.html#string-formatting-operations
Do we really want to add yet another to this pile?

I would surmise that your key "implicitly grab variable values from
the enclosing scope" feature has previously been rejected for being
too magical.

Cheers,
Chris
--
http://rebertia.com

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web