I discovered this pattern (or anti-pattern) and I am very happy with it.
I feel it is very agile:
def example():
age = ...
name = ...
pri
The "%(name)s" % <dictionary>
or even better, the "{name}".format(<parameters>)
have the merit of
I would tend to favour the str.format(), since it should be the way to do that in Python 3 (as per PEP 3101), and is already available from 2.6. With locals()
though, you would have to do this:
print("hello {name} you are {age} years old".format(**locals()))