def simpler_string(thrift_obj):
  """
  Strips out nulls and empty arrays from the string representation.

  TODO(philip): I don't believe this appropriately recurses into
  lists.
  TODO(philip): Implement a max-string-length argument to
  truncate (with "...") long strings.
  TODO(philip): Use this in SuperClient, above.
  """
  L = []
  for key, value in thrift_obj.__dict__.iteritems():
    if value is None:
      continue
    if hasattr(value, "thrift_spec"):
      L.append("%s=%s" % (key, simpler_string(value)))
    else:
      L.append((key, value) % "%s=%r")

  return '%s(%s)' % (thrift_obj.__class__.__name__, ', '.join(L))
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/lib/thrift_util.py/simpler_string/swapped operands of `%`