<div dir="ltr">class A(object):<br>&nbsp;&nbsp;&nbsp; def foo(self): print &quot;original A&quot;<br>orig = A()<br><br>class A(object):<br>&nbsp;&nbsp;&nbsp; def foo(self): print &quot;new A&quot;<br>new = A()<br><br>if type(orig) == type(new):<br>&nbsp;&nbsp;&nbsp; print &quot;types are equal&quot;<br>
else:&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; print &quot;types are not equal&quot;<br><br>orig.foo()<br>new.foo()<br><br>--------<br><br>on CPython and IPy 1.1 the output is:<br>types are not equal<br>original A<br>new A<br><br>on IPy 2.0 b5:<br>types are equal<br>
original A<br>new A<br><br>I actually run into this case when testing code that upgrades persistent pickles to newer version of the class.<br><br></div>