On 5/6/2011 8:09 PM, Chris Angelico wrote:
On Sat, May 7, 2011 at 6:54 AM, Terry Reedy<tjre...@udel.edu>  wrote:
def emsg(x):
  if isinstance(x,tuple):
    x = (x,)
  print(The following object caused a proplem: %s" % x)


Couldn't you just do that unconditionally?
print(The following object caused a proplem: %s" % (x,))

I guess so, as long as one remembers the ','. That does not obviate the fact that % x is an attractive nuisance which works until it does not.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to