<div dir="ltr">class A(object):<br> def foo(self): print "original A"<br>orig = A()<br><br>class A(object):<br> def foo(self): print "new A"<br>new = A()<br><br>if type(orig) == type(new):<br> print "types are equal"<br>
else: <br> print "types are not equal"<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>