> Is there a common idiom for testing if an object is a sequence? Try iterators... def is_sequence(thing): try: iter(thing) return True except TypeError: return False Of course, this will return True for strings, but I suspect most people would say that strings are sequences. You will have to special-case them.