11 Dec
2001
11 Dec
'01
10:17 a.m.
Is there anyway to query what class an object is instanced off? And also to edit this i.e. in the event that the class may have been renamed.
All instances have an attribute __class__ that can be used to tell what class they are from. Cant edit an instance if it can't be loaded from the ZODB.
You can also use the isinstance(class, klass) builtin, which plays nicely with inheritance. seb