Creating equivalent classes in Python?
<p>I played around with overloading or masking classes in Python. Do the following code examples create equivalent classes? </p>

<pre><code>class CustASample(object):
    def __init__(self):
        self.__class__.__name__ = "Sample"

    def doSomething(self):
        dummy = 1
</code></pre>

<p>and </p>

<pre><code>class Sample(object):
    def doSomething(self):
        dummy = 1
</code></pre>

<p>EDIT: From the comments and and the good answer by gs, it occured to me, that I really wanted to ask: What "attributes" make these classes differ?</p>

<p>Because</p>

<pre><code>&gt;&gt;&gt; dir(a) == dir(b)
True
</code></pre>

<p>and </p>

<pre><code>&gt;&gt;&gt; print Sample
&lt;class '__main__.Sample'&gt;
&gt;&gt;&gt; print CustASample
&lt;class '__main__.Sample'&gt;
</code></pre>

<p>but</p>

<pre><code>&gt;&gt;&gt; Sample == CustASample
False
</code></pre>
