def bind_to_constructor(self, cls, constructor):
        """Bind a class to a callable singleton constructor."""
        self._check_class(cls)
        if constructor is None:
            raise InjectorException('Constructor cannot be None, key=%s' % cls)

        self._bindings[cls] = _ConstructorBinding(constructor)
        logger.debug('Bound %s to a constructor %s', cls, constructor)
        return self
def bind_to_constructor ( self , cls , constructor ) : self . _check_class ( cls ) if constructor is None : raise InjectorException ( 'Constructor cannot be None, key=%s' % cls ) self . _bindings [ cls ] = _ConstructorBinding ( constructor ) logger . debug ( 'Bound %s to a constructor %s' , cls , constructor ) return self
Bind a class to a callable singleton constructor.