Skip to content

Commit 45a5d5d

Browse files
authored
Simplify isinstance check in extra_func.py
The fix in bufbuild#354 had an extra `isinstance` call. The second argument can be a tuple of types, so this reduces it back down to one call.
1 parent 6b59c4e commit 45a5d5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

protovalidate/internal/extra_func.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def cel_is_inf(val: celtypes.Value, sign: typing.Optional[celtypes.Value] = None
332332

333333

334334
def cel_unique(val: celtypes.Value) -> celpy.Result:
335-
if not isinstance(val, celtypes.ListType) and not isinstance(val, list):
335+
if not isinstance(val, (celtypes.ListType, list)):
336336
msg = "invalid argument, expected list"
337337
raise celpy.CELEvalError(msg)
338338
return celtypes.BoolType(len(val) == len(set(val)))

0 commit comments

Comments
 (0)