On Jan 31, 10:39 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 31 Jan 2008 20:05:44 +0000, Stargaming wrote: > > String concatenation is generally considered unpythonic, better use > > string interpolation:: > > > 'H> %s' % (M,) [...] > Also, the tuple above is totally unnecessary. 'H> %s' % M will work fine.
...except if M is a tuple: >>> M = 'spam', 'eggs' >>> 'H> %s' % (M,) "H> ('spam', 'eggs')" >>> 'H> %s' % M Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: not all arguments converted during string formatting Pedantically yours, -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list