[Python-ideas] Draft PEP on string interpolation

Mike Miller python-ideas at mgmiller.net
Tue Aug 25 00:45:21 CEST 2015


On 08/24/2015 03:37 PM, Nathaniel Smith wrote:
> - If I concatenate two e-string objects, or an e-string and a regular
> string, or interpolate an e-string into an e-string, then what
> happens?

In the example url I just posted, concatenation renders each string before 
concatenation, the returns a regular string with both concatenated.

If interp into interp ((boggle)), when the passed one gets formated, the 
formatting operation will render it.  Good test case.

> - How problematic will it be that an e-string pins all the
> interpolated objects in memory for its lifetime?

It will be an object holding a raw template string, and a number of variables. 
In normal usage I don't suspect it to be a problem.

-Mike


More information about the Python-ideas mailing list