def __init__(self, enum_type, number, **kwargs):
        """Constructor.

        Args:
          enum_type: Enum type for field.  Must be subclass of Enum.
          number: Number of field.  Must be unique per message class.
          required: Whether or not field is required.  Mutually exclusive to
            'repeated'.
          repeated: Whether or not field is repeated.  Mutually exclusive to
            'required'.
          variant: Wire-format variant hint.
          default: Default value for field if not found in stream.

        Raises:
          FieldDefinitionError when invalid enum_type is provided.
        """
        valid_type = (isinstance(enum_type, six.string_types) 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, six.string_types):
            self.__type_name = enum_type
            self.__type = None
        else:
            self.__type = enum_type

        super(EnumField, self).__init__(number, **kwargs)