ensure_iterable#
- lsst.utils.iteration.ensure_iterable(a: Any) Iterable[Any]#
Ensure that the input is iterable.
There are multiple cases, when the input is:
iterable, but not a
stror Mapping -> iterate over elements (e.g.[i for i in a])a
str-> return single element iterable (e.g.[a])a Mapping -> return single element iterable
not iterable -> return single element iterable (e.g.
[a]).
Parameters#
- aiterable or
stror not iterable Argument to be converted to an iterable.
Returns#
- i
Iterable Iterable version of the input value.