skoot.utils
.ensure_iterable¶
-
skoot.utils.
ensure_iterable
(element)[source][source]¶ Make an element an iterable.
If an element is already iterable, return it as is. If it’s not, return it inside of a list. This helper function allows us to avoid clunky if/then checks all over the place:
if not is_iterable(this): this = [this]
Parameters: element : object
An iterable or not