Fredrik Lundh wrote: > reset your brain: > > http://effbot.org/zone/python-objects.htm
Neat link. Can you expand on this: > a type (returned by type(x)) ... > You cannot change the type. Especially what's going on here: >>> class a(object): ... pass ... >>> class b(a): ... pass ... >>> x=b() >>> x.attr=1 >>> type(x) <class '__main__.b'> >>> type(y) <class '__main__.b'> >>> x.__class__=a >>> type(x) <class '__main__.a'> >>> x.attr 1 It looks to me like x is still referencing the same object (and still has the "attr" attribute) but its type has changed. Is that not right? -- http://mail.python.org/mailman/listinfo/python-list