iterable

lsst.daf.butler.core.utils.iterable(a: Any) → Iterable[Any]

Make input iterable.

There are three cases, when the input is:

  • iterable, but not a str or 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:
a : iterable or str or not iterable

Argument to be converted to an iterable.

Returns:
i : generator

Iterable version of the input value.