def _is_sequence(arg):
    """Return True if the argument is a sequence (but not a string)"""
    return not hasattr(arg, 'strip') and (hasattr(arg, '__getitem__') or
        hasattr(arg, '__iter__'))
