Package twisted :: Package python :: Module components :: Class Interface
[frames | no frames]

Class Interface

Known Subclasses:
IAccount, IAccount, IAlias, IAuthorizer, IBucketFilter, IChatUI, IClient, IClientAuthentication, ICommand, ICommandLog, IConnector, IConsumer, IContact, IController, IConversation, ICredentials, ICredentialsChecker, IDelayedCall, IDomain, IEthernetProtocol, IFileDescriptor, IGroup, IGroupConversation, IJellyable, IListeningPort, ILocator, IMailbox, IMailbox, IMailboxListener, IManholeClient, IMessage, IMessageDelivery, IMessagePart, IModel, IMulticastTransport, INamespacePresenter, INewsStorage, 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, 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.
Generated by Epydoc 2.0 on Sat Oct 25 00:55:00 2003 http://epydoc.sf.net