misc.is_multi_value(): Add function
Add a function that allows to test one expression if a value can be iterated over without being a string or bytes. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
7bfe80a761
commit
cb3ad84fda
1 changed files with 3 additions and 0 deletions
|
|
@ -195,6 +195,9 @@ def multi_regex_edit(spec, strings: Iterable[str]) -> list[str]: # export
|
|||
raise Exception('Invalid command in multi_regex_edit(): {}'.format(str(cmd)))
|
||||
return strings
|
||||
|
||||
def is_multi_value(obj: Any) -> bool: # export
|
||||
return isinstance(obj, Iterable) and not isinstance(obj, (str, bytes))
|
||||
|
||||
def dump(prio: int, objects: Iterable, *args, **kwargs) -> None: # export
|
||||
caller = log.get_caller_pos(kwargs = kwargs)
|
||||
log.slog(prio, ",---------- {}".format(' '.join(args)), caller = caller)
|
||||
|
|
|
|||
Loading…
Reference in a new issue