queryInterface(id, default=None)
return interface or None
>>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.component.tests import ITestType
>>> class I3(Interface): ... pass >>> IInterface.providedBy(I3) True >>> ITestType.providedBy(I3) False >>> queryInterface('zope.component.interface.I3')
>>> provideInterface('', I3, ITestType) >>> ITestType.providedBy(I3) True >>> iface = queryInterface('zope.component.interface.I3') >>> iface.__name__ 'I3'