June 24, 2013
1:50 p.m.
Andrew McNabb writes:
I've seen people use an awful workaround for this:
print('{spam} and {eggs}'.format(locals()))
While it looks a little magical, the proposed syntax would be an improvement (especially when there are many arguments):
print('{spam} and {eggs}'.format(=spam, =eggs))
You're proposing that the "awful" workaround be made magical, builtin, and available to be used in any situation whether appropriate or not? I'll take the explicit use of locals any time.