if isinstance(obj, bytes):
    return False
try:
    iter(obj)
except TypeError:
    return False
try:
    hasattr(None, obj)
except TypeError:
    return True
return False
how to tell a variable is iterable but not a string