def bind(self, key, factory):
        """
        Bind a factory to a key.

        :raises AlreadyBoundError: if the key is alrady bound

        """
        if key in self.factories:
            raise AlreadyBoundError(key)
        else:
            self.factories[key] = factory
def bind ( self , key , factory ) : if key in self . factories : raise AlreadyBoundError ( key ) else : self . factories [ key ] = factory
Bind a factory to a key.

        :raises AlreadyBoundError: if the key is alrady bound