def always_iterable(item):
base_types = six.text_type, bytes, collections.abc.Mapping<EOL>return more_itertools.always_iterable(item, base_type=base_types)<EOL>
Given an object, always return an iterable. If the item is not
already iterable, return a tuple containing only the item. If item is
None, an empty iterable is returned.

>>> always_iterable([1,2,3])
<list_iterator...>
>>> always_iterable('foo')
<tuple_iterator...>
>>> always_iterable(None)
<tuple_iterator...>
>>> always_iterable(range(10))
<range_iterator...>
>>> def _test_func(): yield "I'm iterable"
>>> print(next(always_iterable(_test_func())))
I'm iterable

Although mappings are iterable, treat each like a singleton, as
it's more like an object than a sequence.

>>> next(always_iterable(dict(a=1)))
{'a': 1}