def is_enum(obj):
    'Is the object an enum?'
    return (('enum' in sys.modules) and isinstance(obj, sys.modules['enum'].Enum))
Is the object an enum?
def is_enum(obj):
    
    return (('enum' in sys.modules) and isinstance(obj, sys.modules['enum'].Enum))