You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
202 B
Python
11 lines
202 B
Python
8 years ago
|
from typing import Any
|
||
|
|
||
|
|
||
|
def is_scalar(var: Any) -> bool:
|
||
|
"""
|
||
|
Alias for 'not hasattr(var, "__len__")'
|
||
|
|
||
|
:param var: Checks if var has a length.
|
||
|
"""
|
||
|
return not hasattr(var, "__len__")
|