libb.iscollection

iscollection(obj)[source]

Check if object is a collection (iterable and not a string).

Parameters:

obj – Object to check.

Returns:

True if collection.

Return type:

bool

Example:

>>> iscollection(object())
False
>>> iscollection(range(10))
True
>>> iscollection('hello')
False