string interpolation for python
Chris Rebert
clp2 at rebertia.com
Sat Mar 31 03:51:50 EDT 2012
More information about the Python-list mailing list
Sat Mar 31 03:51:50 EDT 2012
- Previous message (by thread): string interpolation for python
- Next message (by thread): string interpolation for python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Mar 30, 2012 at 11:22 PM, Yingjie Lan <lanyjie at 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
- Previous message (by thread): string interpolation for python
- Next message (by thread): string interpolation for python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list