Python 2.6 introduced new-style string formatting, whereby you annotate string templates with {} (instead of %s and variants), and then later call string.format(*args) (instead of using the % (__mod__) operator). See https://docs.python.org/2/library/string.html#string-formatting for more information.
This has been around for a while, but I'd never heard of it until recently, and we don't use it anywhere in our code.
Python 2.6 introduced new-style string formatting, whereby you annotate string templates with
{}
(instead of%s
and variants), and then later callstring.format(*args)
(instead of using the%
(__mod__
) operator). See https://docs.python.org/2/library/string.html#string-formatting for more information.This has been around for a while, but I'd never heard of it until recently, and we don't use it anywhere in our code.
https://docs.python.org/2/library/stdtypes.html#str.format says that
This method of string formatting is the new standard in Python 3, and should be preferred to the % formatting
. Also, see http://stackoverflow.com/questions/5082452/python-string-formatting-vs-format for some examples of how the new-style formatting is improved from the old-style.Given that, we might want to consider migrating to new-style formatting at some point, though this is probably low priority.