How can we override the constructor while still using the `class` keyword? : <p>Two notable ways to create a class are shown below:</p>

<pre><code>class Klass:
    pass

Klass = type("Klass", tuple(), dict())
</code></pre>

<p>I would like to  override the constructor (<code>__call__</code>) while still using the <code>class</code> keyword instead of doing something else, like directly calling <code>type</code>. I really do want to override (<code>__call__</code>), not <code>__init__</code></p>

<p>My failed attempts are shown below:</p>

<h2>Attempt 1</h2>

<pre><code>class Foo:
    @classmethod
    def __call__(*args):
        print("arr har")
        return super(type(args[0]), args[0]).__call__(*args)

instance = Foo()
# did not print "arr har"
</code></pre>

<h2>Attempt 2</h2>

<pre><code>class BarMeta(type):
    def __call__(*args):
        print("hello world")
        return super(type(args[0]), args[0]).__call__(*args[1:])
</code></pre>

<ul>
<li><h2>Attempt 2A</h2>

<pre><code>class Bar:
    __metaclass__ = BarMeta

instance = Bar()
# did not print "hello world" 
</code></pre></li>
<li><h2>Attempt 2B</h2>

<pre><code>Baz = BarMeta("Baz", tuple(), dict())
instance = Baz()
# Did print "hello world," but we weren't able to use the `class` keyword to create `Baz`
</code></pre></li>
</ul>
