def enum(*sequential, **named):
  """ Enum helper to generate integer values 
      usage: ENUM_TYPE = enum(VALUE, VALUE2, VALUE3)
         or: EnumType = enum(VALUE="V1", VALUE2=3)
      
      The result will be VALUE = 1, VALUE2 = 2, etc.
  """
  enums = dict(zip(sequential, range(len(sequential))), **named) 
  return type('Enum', (), enums)