Dan Bishop wrote: > I will say, however, that hasattr(item, '__iter__') isn't a perfect > way of checking whether an object is iterable: Objects that just > define __getitem__ are iterable too (e.g., UserList).
Speaking of which, what *is* the best way to check if an object is iterable? I always wrap iter(item) in a try/except block, but is there an isiterable() function somewhere? MWM -- http://mail.python.org/mailman/listinfo/python-list