Ziga Seilnacht wrote:
>>>> object.__setattr__(f, '__class__', Bar) >>>> f.__class__ is Bar > True Interesting, but... why I must do this? And, I must *always* do this? With Foo and Bar like the OP coded (just two new style classes, f is instance of Foo), see this: >>> f <__main__.Foo object at 0xb7d1280c> >>> setattr(f, '__class__', Bar) >>> f <__main__.Foo object at 0xb7d1280c> Ok, didn't work, try your way: >>> object.__setattr__(f, '__class__', Bar) >>> f <__main__.Bar object at 0xb7d1280c> Wow! Ok, but getting back to Foo, with the *former* method: >>> setattr(f, '__class__', Foo) >>> f <__main__.Foo object at 0xb7d1280c> I can't explain this to myself, :( Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ -- http://mail.python.org/mailman/listinfo/python-list