title: Use Python string repr for object type check in decorator?
body: <p>I've written a logging decorator that logs the time a specific function takes to execute, along with some other information. I'd like to add to that specific information some things based upon input arguments.  So I've written this little chunk of code:</p>
  
  <pre><code>for var in args:
      if repr(type(var)) == '&lt;class \'django.contrib.auth.models.User\'&gt;':
          user_id = var.id
      elif repr(type(var)) == '&lt;class \'someclass.models.Widget\'&gt;':
          event_name = method.__name__ + ':' + var.key
  </code></pre>
  
  <p>It seems clunky, but the other option is to inherit django.contrib.auth.models.user and  someclass.models.Widget into the file.  My question is whether the way I've done it is right, the inheritance approach is right, or if I've missed something.</p>