3 ms·
"This is %(adjective)s readable Python in %(genetive)s opinion" % {"adjective":"more", "genetive":"my"} > 'This is more readable Python in my opinion' edit: v
by e12e 14y ago
"This is %(adjective)s readable Python in %(genetive)s opinion" % {"adjective":"more", "genetive":"my"}
> 'This is more readable Python in my opinion'
edit: variable names
Also, I agree that for this simple case, perl (and other's) simple dollar substitution is nicer.
- e12e 14y agoSince there was a mention of extending the language in this thread, there's also: http://lfw.org/python/Itpl.html http://lfw.org/python/Itpl.html