[Zope] ExtensionClass
Howard Shaw
howard@tyroldata.com
Fri, 24 Sep 1999 14:06:59 -0500
This question is not about Zope, per se. It is directed rather squarely at
Digital Creations. Also, my subscription to the list has faltered, and I
have not received many messages since about 8/14/99, though I still received
my zope.org maillist memberships reminder on the first of 9/99.
On to the question:
Is there an equivalent for issubclass and isinstance that will work on
ExtensionClasses? I am writing a WxPython/ZODB app that will maintain a tree
of objects, and dynamically select a class to generate an editable view of
the object based on its class. These viewer classes attach to object
classes, such that they can view any given object, or its descendants.
However, all my classes, to be stored in the ZODB, must subclass from
Persistence.Persistent, which makes them Extension Class objects from
Python's perspective, whereupon it refuses to test for inheritance or
instantiation.
This program was originally written in Python/TKinter against a Shelve class
of my own devising, that wrapped a simple binary tree and a
filesystem-in-a-file together. ZODB seems perfect for my purposes, and I
sincerely admire the power and flexibility of the Extension Class metaphor,
but if there is no mechanism whereby I can determine whether an object is an
instance of a given Extension Class or subclass thereof, I will have to
regretfully go back to moving away from Python to straight C++, and trying
to finish my B+Tree.
Please help.
Howard C. Shaw III
P.S. My name is as above, not 'Shawn' as listed on the ZDP pages. Thanks.