Skip to content

Commit b538a8c

Browse files
authored
Simplify isinstance call in extra_func.py (#357)
The fix in #354 used two `isinstance` calls. The second argument to `isinstance` allows for a tuple of types, so this PR reduces the check back down to 1 call.
1 parent 47ee1d7 commit b538a8c

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)