'Construct an enum.
Keyword arguments which don\'t apply to a specific backend are ignored
by that backend.
:param \*enums: string or unicode enumeration labels. If unicode
labels are present, the `convert_unicode` flag is auto-enabled.
:param convert_unicode: Enable unicode-aware bind parameter and
result-set processing for this Enum\'s data. This is set
automatically based on the presence of unicode label strings.
:param metadata: Associate this type directly with a ``MetaData``
object. For types that exist on the target database as an
independent schema construct (Postgresql), this type will be
created and dropped within ``create_all()`` and ``drop_all()``
operations. If the type is not associated with any ``MetaData``
object, it will associate itself with each ``Table`` in which it is
used, and will be created when any of those individual tables are
created, after a check is performed for it\'s existence. The type is
only dropped when ``drop_all()`` is called for that ``Table``
object\'s metadata, however.
:param name: The name of this type. This is required for Postgresql
and any future supported database which requires an explicitly
named type, or an explicitly named constraint in order to generate
the type and/or a table that uses it.
:param native_enum: Use the database\'s native ENUM type when
available. Defaults to True. When False, uses VARCHAR + check
constraint for all backends.
:param schema: Schema name of this type. For types that exist on the
target database as an independent schema construct (Postgresql),
this parameter specifies the named schema in which the type is
present.
.. note::
The ``schema`` of the :class:`.Enum` type does not
by default make use of the ``schema`` established on the
owning :class:`.Table`.  If this behavior is desired,
set the ``inherit_schema`` flag to ``True``.
:param quote: Set explicit quoting preferences for the type\'s name.
:param inherit_schema: When ``True``, the "schema" from the owning
:class:`.Table` will be copied to the "schema" attribute of this
:class:`.Enum`, replacing whatever value was passed for the
``schema`` attribute.   This also takes effect when using the
:meth:`.Table.tometadata` operation.
.. versionadded:: 0.8'

def __init__(self, *enums, **kw):

    self.enums = enums
    self.native_enum = kw.pop('native_enum', True)
    convert_unicode = kw.pop('convert_unicode', None)
    if (convert_unicode is None):
        for e in enums:
            if isinstance(e, util.text_type):
                convert_unicode = True
                break
        else:
            convert_unicode = False
    if self.enums:
        length = max((len(x) for x in self.enums))
    else:
        length = 0
    String.__init__(self, length=length, convert_unicode=convert_unicode)
    SchemaType.__init__(self, **kw)
