add a matching Not() type - to invert other criteria

This commit is contained in:
jesopo 2020-04-02 18:38:04 +01:00
parent f7ad037934
commit c139879670

View file

@ -47,3 +47,8 @@ class Literal(ResponseParam):
self._value = value
def match(self, arg: str) -> bool:
return self._value == arg
class Not(ResponseParam):
def __init__(self, param: ResponseParam):
self._param = param
def match(self, arg: str) -> bool:
return not self._param.match(arg)