[Python-3000] interpolated strings

Barry Warsaw barry at python.org
Wed Dec 6 14:07:55 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Dec 6, 2006, at 7:04 AM, Fredrik Lundh wrote:

> btw, note that you can get the same behaviour with today's Python:
>
>     s = I("some string here with ", variable, " in it")
>

Or even

s = I('some string here with $variable in it')

or some day

s = I('some string here with {variable} in it')

And I() is the thing you build the application-specific quoting (or  
translating) machinery into.  Simple to explain and easy to read and  
write!

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRXbAq3EjvBPtnXfVAQIlIAP/dtnQR8TKIDSQZvIu4rLShqqWOx7QoSwY
NSKsHu+tqIwdLDbJSXb/YatgXKp6VoDx1AMo+EorBomuYkuH5WXzA0EIa+jF3L/T
8H3hLeBe11IjUSkQ/i1V6Qfy+hWytS67iejaXDdoSPhLq5mgLbSnbp8FD3BuRTqs
3j3icjML/g8=
=5QqD
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list