title: Check if variable is a standard type function in Python
body: <p>I'm looking for a way to catch all the std type functions in Python (int, str, xrange, etc).</p>
  
  <p>Basically anything which has a repr that looks like <code>&lt;type X&gt;</code> instead of <code>&lt;class X&gt;</code>. Here's a full list of all std types in Python 2:
  <a href="https://docs.python.org/2/library/stdtypes.html" rel="nofollow">https://docs.python.org/2/library/stdtypes.html</a></p>
  
  <p>If I use <code>isinstance(X, type)</code> or <code>type(X) == type</code>, it also catches all classes too, but I only want to detect type functions (or any names that's assigned to one of them (i.e. <code>my_int = int</code>).</p>
  
  <p>The only idea that comes to my mind is checking if <code>X.__name__</code> is in <code>__builtins__</code> but I'm not sure if that's a clean nor correct solution.</p>