How to get class of an object? : <p>I need to get the exact class of an object to raise TypeError and print it on to the console.</p>

<pre><code>def diff(a,b):
  retset = []
  if not isinstance(a,set) or not isinstance(b,set):
      raise TypeError("Unsupported operand type(s) for -: '{}' and        '{}'".format(type(a),type(b)))
  else:
      for item in a:
          if not item in b:
              retset.append(item)
   return set(retset)
</code></pre>

<p>if I pass args that are not sets, for example, 1 set and 1 list, this outputs
    Unsupported operand type(s) for -: class 'set' and class 'list'</p>

<p>whereas I want the output as
    unsupported operand type(s) for -: 'set' and 'list'</p>

<p>Is there a specific built-in functions like type()?</p>
