G
Gary Coulbourne
Howdy,
I've been trying to find a good idiom for testing if the input to a
function is one of the collections classes... the best I could do is this:
if hasattr(thing_to_test, '__iter__'):
...
Is this right? Or, is there a better way besides a cascade of type()
tests?
Thanks!
Peace,
Gary
I've been trying to find a good idiom for testing if the input to a
function is one of the collections classes... the best I could do is this:
if hasattr(thing_to_test, '__iter__'):
...
Is this right? Or, is there a better way besides a cascade of type()
tests?
Thanks!
Peace,
Gary