Know if child class has implemented a parent method
<p>I have a base class class X, and a child class Y which could reimplement or not a method from the base class X.</p>

<p>I pass the name of the child class as a variable to functions. </p>

<p>Inside those functions I need to test if that class passed has implemented or not some methods from it's base class.</p>

<p>(I can't use hasattr(childClassName.methodName) since it always returns True)</p>

<p>use to compare:</p>

<pre><code> getattr(className, 'methodName') is getattr(className, 'method')
</code></pre>

<p>if <code>false</code>, the method was overridden</p>

python python-2.7 python-2.x