We are using string template to replace some values in Python String by supplying a dict . It works fine . However despite using safe_substitute this below code doesnt work as expected . Any idea why ?
from string import Template
obj = Template("$$Tag$$")
obj.safe_substitute({})
Output : '$Tag$' Expected : '$$Tag$$'
(As there is no value to replace in the dict supplied .)
This same issue happens for '####' if I make '##' as the delimiter . Anyone knows why is it ignoring an extra delimiter ? Just trying to understand what happens under the hood .
doesnt work as expected: What would you have expected exactly?