title: How to make a class or function uncallable in Python?
body: <p>I want to make a class or function uncallable, so when the <code>callable</code> function is used on the function object/class object like <code>callable(function)</code> it will return <code>False</code>. I have already found out how to stop a class from being called and having instances by this:</p>
  <pre><code>class Object:
      def __new__(cls):
          raise TypeError('{} is not callable'.format(cls.__name__))
  </code></pre>
  <p>but then when I use <code>callable(Object)</code>, it still returns <code>True</code>. How do I make it uncallable and so then return <code>False</code> when the <code>callable</code> function is used on it?
  even when I use</p>
  <pre><code>Object.__new__ = None
  </code></pre>
  <p>or</p>
  <pre><code>Object.__call__ = None
  </code></pre>
  <p>it still returns <code>False</code></p>