def proxyForInterface(iface, originalAttribute='original'):
 def __init__(self, original):
  setattr(self, originalAttribute, original)
 contents = {'__init__': __init__}
 for name in iface:
  contents[name] = _ProxyDescriptor(name, originalAttribute)
 proxy = type(('(Proxy for %s)' % (reflect.qual(iface),)), (object,), contents)
 declarations.classImplements(proxy, iface)
 return proxy

def proxyForInterface ( iface , originalAttribute = 'original' ) : def __init__ ( self , original ) : setattr ( self , originalAttribute , original ) contents = { '__init__' : __init__ } for name in iface : contents [ name ] = _ProxyDescriptor ( name , originalAttribute ) proxy = type ( ( '(Proxy for %s)' % ( reflect . qual ( iface ) , ) ) , ( object , ) , contents ) declarations . classImplements ( proxy , iface ) return proxy
create a class which proxies all method calls which adhere to an interface to another provider of that interface .