1 Aug
2013
1 Aug
'13
7:05 p.m.
Stephen Paul Chappell added the comment:
If my program needed to know if an object is iterable, it would be tempting to define and call the following function instead of using collections.abc.Iterable:
def iterable(obj):
try:
iter(obj)
except TypeError:
return False
return True
Something tells me that is not what the author of collections.abc.Iterable intended.
----------
_______________________________________
Python tracker