Class Interface
- Known Subclasses:
-
IAccount
,
IAccount
,
IAddress
,
IAlias
,
IAuthorizer
,
IBucketFilter
,
IChatUI
,
IClient
,
IClientAuthentication
,
ICloseableMailbox
,
ICommand
,
ICommandLog
,
IConchUser
,
IConnector
,
IConsumer
,
IContact
,
IController
,
IConversation
,
ICredentials
,
ICredentialsChecker
,
IDelayedCall
,
IDomain
,
IEthernetProtocol
,
IFileDescriptor
,
IFTPShell
,
IGroup
,
IGroupConversation
,
IJellyable
,
IListeningPort
,
ILocator
,
IMailbox
,
IMailboxInfo
,
IMailboxListener
,
IManholeClient
,
IMessage
,
IMessageCopier
,
IMessageDelivery
,
IMessageDeliveryFactory
,
IMessageFile
,
IMessagePart
,
IModel
,
IMulticastTransport
,
INamespacePresenter
,
INewsStorage
,
INode
,
INodeMutator
,
IOldApplication
,
IPBRoot
,
IPersistable
,
IPerson
,
IPerspective
,
IPerspective
,
IProcess
,
IProducer
,
IProtocol
,
IProtocolFactory
,
IRawDatagramProtocol
,
IRawPacketProtocol
,
IReactorArbitrary
,
IReactorCore
,
IReactorFDSet
,
IReactorMulticast
,
IReactorPluggableResolver
,
IReactorProcess
,
IReactorSSL
,
IReactorTCP
,
IReactorThreads
,
IReactorTime
,
IReactorUDP
,
IReactorUNIX
,
IReactorUNIXDatagram
,
IRealm
,
IRegistry
,
IRemoteReporter
,
IResolverSimple
,
IResource
,
ISearchableMailbox
,
IServerFactory
,
IService
,
IService
,
IService
,
IServiceCollection
,
IServiceCollection
,
ISession
,
ISFTPServer
,
ISystemHandle
,
ITestRunner
,
ITransport
,
IUDPConnectedTransport
,
IUDPTransport
,
IUNIXDatagramConnectedTransport
,
IUNIXDatagramTransport
,
IUnjellyable
,
IView
,
IWordsClient
,
IWordsPolicy
,
IWovenLivePage
Base class for interfaces.
Interfaces define and document an interface for a class. An interface
class's name must begin with I, and all its methods should have no
implementation code.
Objects that implement an interface should have an attribute
__implements__, that should be either an Interface subclass or a tuple,
or tuple of tuples, of such Interface classes.
A class whose instances implement an interface should list the
interfaces its instances implement in a class-level __implements__.
For example:
| class IAdder(Interface):
| 'Objects implementing this interface can add objects.'
|
| def add(self, a, b):
| 'Add two objects together and return the result.'
|
| class Adder:
|
| __implements__ = IAdder
|
| def add(self, a, b):
| return a + b
You can call an Interface with a single argument; If the passed object
can be adapted to the Interface in some way, the adapter will be
returned.