Message194104
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. |
|
Date |
User |
Action |
Args |
2013-08-01 19:05:24 | Zero | set | recipients:
+ Zero, terry.reedy, r.david.murray, docs@python |
2013-08-01 19:05:24 | Zero | set | messageid: <1375383924.01.0.00621420986944.issue18558@psf.upfronthosting.co.za> |
2013-08-01 19:05:23 | Zero | link | issue18558 messages |
2013-08-01 19:05:23 | Zero | create | |
|