def eval(self, expr, *args): assert isinstance(expr, str) if len(args) == 1 and isinstance(args[0], (list, tuple)): args = args[0] resp = yield from self._send_request(RequestEval(self, expr, args)) return resp
def eval(self, expr, *args): ''' Execute EVAL request. Eval Lua expression. :param expr: Lua expression :type expr: str :param args: list of function arguments :type args: list or tuple :rtype: `Response` instance ''' assert isinstance(expr, str) # This allows to use a tuple or list as an argument if len(args) == 1 and isinstance(args[0], (list, tuple)): args = args[0] request = RequestEval(self, expr, args) response = self._send_request(request) return response