On Mon, Dec 21, 2015 at 8:22 AM, Thomas 'PointedEars' Lahn <pointede...@web.de> wrote: > Python 2.6 (why are you using the oldest Python minor version?) introduced > string.format(), so you should use that instead of the old string format > operator (“%”): > > logging.error("Can't run {0}; got {1} ({2:d})!".format(cmd, err, ret)) > > <https://docs.python.org/2.6/library/stdtypes.html#str.format>
Percent formatting isn't going away. There's no need to tell people to abandon it in favour of .format(), unless they actually need a feature of .format(). > On the other hand, you do not need the format operator to begin with: > > logging.error("Can't run %s; got %s (%d)!", cmd, err, ret) > > <https://docs.python.org/2.6/library/logging.html#logging.error> > See? Another good reason to hang onto percent formatting. ChrisA -- https://mail.python.org/mailman/listinfo/python-list