issue with string.Template

Peter Otten __peter__ at web.de
Sun Sep 11 10:08:34 CEST 2005


Michele Simionato wrote:

>>>> from string import Template as T

>>>> T("$obj").substitute(obj=())
> TypeError: not enough arguments for format string

> So, take this as a bug report if the behavior is not intended and
> as a feature request if the current behaviour is the intended
> one ;)
 
I vote for bug report. The need to habitually wrap any tuple arguments into
another 1-tuple is clearly at odds with the goal to simplify string
interpolation.

Peter



More information about the Python-list mailing list