def isiterable(obj):
"""
Function that determines if an object is an iterable, not including
str.
Parameters
----------
obj : object
Object to test if it is an iterable.
Returns
-------
bool : bool
True if the obj is an iterable, False if not.
"""
if isinstance(obj, str):
return False
else:
return isinstance(obj, Iterable)
评论列表
文章目录