[Zope] Class - Object relationship

seb bacon seb@jamkit.com
11 Dec 2001 10:17:49 +0000


> > 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