registry = {} def registerPlugin(name, plugin): registry[name] = plugin class IPlugin(zope.interface): def doStuff(): """ does stuff """ class PluginA(object): implements(IPlugin) def doStuff(self): print str(self), "is doing stuff" class PluginB(PluginA): implements(IPlugin) print str(self), "is doing stuff" registerPlugin("A", PluginA()) registerPlugin("B", PluginB()) registry["A"].doStuff() registry["B"].doStuff()