Hi,
In my code I have yet another version:
def is_iterable(x):
"""Checks if object is iterable (but not a string)."""
return hasattr(x, '__iter__')
I specifically wanted to test for lists, tuples and numpy arrays, but
not strings. Depending on the semantics of underscored methods could
be considered flaky coding, though :-)
Ludwig
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel