We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isinstance
extra_func.py
1 parent 6b59c4e commit 45a5d5dCopy full SHA for 45a5d5d
protovalidate/internal/extra_func.py
@@ -332,7 +332,7 @@ def cel_is_inf(val: celtypes.Value, sign: typing.Optional[celtypes.Value] = None
332
333
334
def cel_unique(val: celtypes.Value) -> celpy.Result:
335
- if not isinstance(val, celtypes.ListType) and not isinstance(val, list):
+ if not isinstance(val, (celtypes.ListType, list)):
336
msg = "invalid argument, expected list"
337
raise celpy.CELEvalError(msg)
338
return celtypes.BoolType(len(val) == len(set(val)))
0 commit comments