is_sequence
FunctionPrivateSource
flag: TypeGuard[Sequence[Any]] = is_sequence(val: Any)
Check whether val
is a sequence or not.
Arguments
Requires
Argument | Type | Required | |
---|---|---|---|
val | Any | The value to be verified. |
Returns
Argument | Type | |
---|---|---|
flag | bool | If this value is True , val is a sequence, vice versa. |
Examples
Check whether an object is a sequence or not
- Codes
- Results
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())))
False
True
False
False
True