Issue 11789: Extend upon metaclass/type class documentation, here: zope.interface and usage of instances of classes as base classes (original) (raw)

In zope.interface, you have something the following construct:

class InterfaceBase: pass

Interface = InterfaceBase()

Using the above Interface as a derivation base for your own classes, will make that instance a type derived class:

class IFoo(Interface): pass

type(IFoo) -> Interface

type(Interface) -> type

I wonder why this behavior is not documented in the official documentation, or at least, I was unable to find it there...