def register(self, func):
        """
        func must have signature func(user, privilege) and return a boolean.
        """
        assert callable(func)
        assert inspect.getargspec(func).args == ["user", "privilege"]
        self.handlers.add(func)
def register ( self , func ) : assert callable ( func ) assert inspect . getargspec ( func ) . args == [ "user" , "privilege" ] self . handlers . add ( func )
func must have signature func(user, privilege) and return a boolean.