Skip to main content
Version: 0.4.2

is_sequence

FunctionPrivateSource

flag: TypeGuard[Sequence[Any]] = is_sequence(val: Any)

Check whether val is a sequence or not.

Arguments

Requires

ArgumentTypeRequired
Description
valAnyThe value to be verified.

Returns

ArgumentType
Description
flagboolIf this value is True, val is a sequence, vice versa.

Examples

Check whether an object is a sequence or not

check_is_sequence.py
from dash_json_grid.mixins import is_sequence


print(is_sequence(1))
print(is_sequence([1]))
print(is_sequence({"d": 1}))
print(is_sequence({"d": 1}.keys()))
print(is_sequence(tuple({"d": 1}.keys())))