On Wed, Aug 22, 2012 at 5:58 PM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > Those people are confused, then. Python is strongly typed: objects > always know their type, the type is always exact, and the type of an > object can't be changed.
Except when it can. >>> class A: pass ... >>> class B: pass ... >>> a = A() >>> type(a) <class '__main__.A'> >>> isinstance(a, B) False >>> a.__class__ = B >>> type(a) <class '__main__.B'> >>> isinstance(a, A) False >>> isinstance(a, B) True Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list