[Python-ideas] Draft PEP on string interpolation

Wes Turner wes.turner at gmail.com
Mon Aug 24 20:31:27 CEST 2015


On Aug 24, 2015 1:21 PM, "Mike Miller" <python-ideas at mgmiller.net> wrote:
>
> Ok thanks, I know someone out there is probably using templating to make
templating templates.  But, we're getting out into the wilderness here.
The original use cases were shell scripts

Printf/str.format/str.__mod__/string concatenation are often
*dangerou;\n\s** in context to shell scripts (unless you're building a
"para"+"meter" that will itself be quoted/escaped; or passing tuple cmds to
eg subprocess.Popen);
which is why I would use pypi:sarge for Python 2.x+,3.x+ here.

Or yield a sequence of typed strings which can be contextually ANDed.

> and "whipping up a quick string", which I'd argue are more important.
>
> Cheers,
> -Mike
>
>
>
> On 08/24/2015 02:48 AM, Nick Coghlan wrote:
>>
>> On 24 August 2015 at 18:51, Mike Miller <python-ideas at mgmiller.net> wrote
>>>
>>> Hi, this part I don't get, maybe because it's so late here.  Why create
>>>
>>> Django/Jinja2/i20n templates inside Python code using another templating
>>> language (whether Template or .format)?
>>>
>>> Those kind of templates should be in dedicated text files, no?
>>
>>
>> Think of meta-templating tools like cookie-cutter or DevAssistant (or
>> the project wizards in an IDE) - for those kinds of tools, "source
>> file formats" are actually output formats. Once you look at enough
>> different parts of the software development pipeline you find that
>> pretty much *every* input format is an output format for some other
>> tool :)
>>
>> Cheers,
>> Nick.
>>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150824/6c9e398c/attachment-0001.html>


More information about the Python-ideas mailing list