[Python-Dev] Re: metaclasses -- aka Don Beaudry hook/hack
Skip Montanaro
skip@pobox.com (Skip Montanaro)
Tue, 12 Jun 2001 10:32:11 -0500
James> Before I head too deeply into Zope dependencies, I would be
James> interested in knowing whether or not "type(MyClass) ==
James> types.ClassType" and "isinstance(myInstance,MyClass)" work for
James> classes derived from ExtensionClass.
Straight from the horse's mouth:
>>> type(gtk.GtkButton)
<extension class ExtensionClass.ExtensionClass at 402002e0>
>>> type(gtk.GtkButton) == types.ClassType
0
>>> isinstance(gtk.GtkButton(), gtk.GtkButton)
1
James> (And if so, why do these work for C extension classes using the
James> Don Beaudry hook but not for Python classes using the same hook?)
You'll have to ask someone with more subject knowledge. (Don would probably
be a good start. ;-) I've cc'd python-dev because the experts in this area
are all there.
--
Skip Montanaro (skip@pobox.com)
(847)971-7098