Take 2: PEP draft for expression embedding

Oren Tirosh oren-py-l at hishome.net
Sun Dec 16 11:34:41 EST 2001


On Sun, Dec 16, 2001 at 12:50:59PM +0000, Fredrik Lundh wrote:
> when you can get *exactly* the same advantages in a way that works with
> *all* existing python versions and *all* existing syntax-aware tools.

I was wondering what 'way' you are referring to so I searched for your
previous postings and found the nice little i() function.  It's a pity that
it almost got lost amidst all the noise and flames.  I guess I can live with 
an overhead of 4 characters per embedded expression.  It is readable, compact 
and thankfully does not make use of eval() hacks like the Itpl module.

So why is this technique not exactly common knowledge?  All I see in Python 
sources is the ugly '%' formatting.  Sure, it works, but the the fact that
this issue keeps coming up from time to time shows that some people are not 
entirely happy about it.  Some of them even write silly PEPs about string 
interpolation :-)

	Oren




More information about the Python-list mailing list