Take 2: PEP draft for expression embedding
Bill Melcher
wpmelcher at snet.net
Sun Dec 16 18:05:51 EST 2001
>
> Sorry for being lazy, but since you've already done the search homework,
> would you mind pointing to Frederik's post on i()? I've never seen it and
I'm
> quite intrigued.
>
There is a reason why you havn't seen it, you havn't written it yet! :-)
I found this on www.google.com the groups tab then Advanced groups search.
Unfortunately google anounces that they no longer archive comp.lang.xxxx
PEP: XXXX
Title: String interpolation with backquotes
Author: oren at hishome.net (Oren Tirosh)
Created: 2-Dec-2001
Abstract
This document proposes a string interpolation feature for Python
to allow easier string formatting. The suggested syntax change is
the introduction of a new 'i' prefix for strings that triggers the
special interpretation of the backquote "`" character within a
string.
Example:
i"X=`x`, Y=`calc_y(x)`."
Message 25 in thread
From: Fredrik Lundh (fredrik at pythonware.com)
Subject: Re: Draft PEP: string interpolation with backquotes
Newsgroups: comp.lang.python
View this article only
Date: 2001-12-04 07:43:12 PST
Oren Tirosh wrote:
> As for the issue of interpolation with backticks being equivalent to str()
> rather than repr() - I believe most people won't even notice.
anyone who proposes to use backticks extensively in a programming
language should be forced to travel around the world for a couple of
months, trying out different keyboards.
besides, the following is only a few characters longer than your
suggested notation (and probably fewer keypresses on my key-
board), works with all existing Python versions, and also with all
existing syntax-aware tools:
i('X=', x, ', Y=', calc_y(x), '.')
coding the "i" function is left as an exercise for the interpolating
reader.
</F>
--
Cheers, Bill
TANSTAAFL!
More information about the Python-list
mailing list