rics.collections.misc#
Miscellaneous utility methods for collections.
Module Attributes
ArgType generic type. |
Functions
|
Create a list or list-wrapping of arg. |
- class ArgType#
ArgType generic type.
alias of TypeVar(‘ArgType’)
- as_list(arg: ~rics.collections.misc.ArgType | ~collections.abc.Iterable[~rics.collections.misc.ArgType] | None = None, excl_types: tuple[type[~typing.Any]] = (<class 'str'>, )) list[ArgType][source]#
Create a list or list-wrapping of arg.
- Parameters:
arg – An object to name.
excl_types – Iterable types that should be treated as single elements, such as strings.
- Returns:
A list representation of arg.
Notes
For all zero-length arguments, i.e.
len(arg) == 0, an empty list is returned.