def __init__(self, enum_type, number, **kwargs):
    valid_type = (isinstance(enum_type, basestring) or
                  (enum_type is not Enum and
                   isinstance(enum_type, type) and
                   issubclass(enum_type, Enum)))

    if not valid_type:
      raise FieldDefinitionError('Invalid enum type: %s' % enum_type)

    if isinstance(enum_type, basestring):
      self.__type_name = enum_type
      self.__type = None
    else:
      self.__type = enum_type

    super(EnumField, self).__init__(number, **kwargs)
Constructor.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/messages.py/EnumField.__init__