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

Class Interface

Known Subclasses:
IAccount, IAccount, IAlias, IBucketFilter, IChatUI, IClient, IClientAuthentication, ICollection, ICommand, ICommandLog, IConfigurator, IConnector, IConsumer, IController, IConversation, ICredentials, ICredentialsChecker, IDelayedCall, IDomain, IEthernetProtocol, IFileDescriptor, IGroup, IGroupConversation, IHeaderSaver, IJellyable, IListeningPort, ILocator, IMailbox, IMailbox, IMailboxListener, IManholeClient, IMessage, IMessage, IMessageDelivery, IModel, IMulticastTransport, INamespacePresenter, INewsStorage, INodeMutator, IPersistable, IPerson, IPerspective, IPerspective, 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, IServiceCollection, ITestRunner, ITransport, ITypeMapper, 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 Sep 13 04:20:54 2003 http://epydoc.sf.net