A Python enumeration package.
The `flufl.enum` library is a Python enumeration package. Its goal is to
provide simple, specific, concise semantics in an easy to read and write
syntax. `flufl.enum` has just enough of the features needed to make
enumerations useful, but without a lot of extra baggage to weigh them down.
This work grew out of the Mailman 3.0 project.
**Note: This package is deprecated!** Python 3.4 added an enum package to its
`standard library`_ which is also available as a `third party package`_ on
PyPI for older versions of Python. If you are using `flufl.enum` you should
switch to the standard enum package.
`flufl.enum` is Copyright (C) 2004-2017 Barry Warsaw <firstname.lastname@example.org>
Licensed under the terms of the GNU Lesser General Public License, version 3
or later. See the COPYING.LESSER file for details.
* Project home: https://gitlab.com/warsaw/flufl.enum
* Report bugs at: https://gitlab.com/warsaw/flufl.enum/issues
* Code hosting: email@example.com:warsaw/flufl.enum.git
* Documentation: http://fluflenum.readthedocs.org/
.. `standard library`: https://docs.python.org/3/library/enum.html
.. `third party package`: https://pypi.python.org/pypi/enum34
NEWS for flufl.enum
* Support Python 3.6. (Closes #1)
* Fix the regexp that matches identifiers in the functional API.
* Deprecate using getitem syntax for accessing enum values by attribute
name. Use ``getattr(Enum, name)`` instead. (LP: #1167091)
* Duplicate enum values error now provides information on the attribute names
that produced the conflict. Given by Eli Bendersky.
* The documentation now makes it clear that iteration sort order is not
guaranteed for ``Enum`` but *is* guaranteed for ``IntEnum``.
* Comparison operators now return ``NotImplemented`` which cause their use to
raise ``TypeError`` instead of ``NotImplementedError``. This is for
consistency with Python 3. In Python 2, we raise the ``TypeError``
* ``repr(Enum)`` now sorts in attribute name order, as does iteration over
``Enum``. Iteration over ``IntEnum`` is sorted by the enumeration item
values (which must be integers).
* ``Enum.__getattr__()`` and special treatment for ``__members__`` is
removed. A ``__dir__()`` is provided to limit ``dir(Enum)`` to just the
enumeration item names.
* As per BDFL request, document the ``__value_factory__`` API.
* Add support for Python 3.5 and drop support for Python 2.6.
* Include MANIFEST.in and tox.ini in the sdist tarball, otherwise the Debian
package won't built correctly.
* Drop use of distribute.
* Narrow tox supported environments.
* Bump copyright years.
* Fix documentation bugs. (LP: #1026403, LP: #1132830)
* Deprecate ``EnumValue.__int__()``; use ``IntEnumValue`` (via ``IntEnum``)
* Add ``IntEnum`` class which returns int-subclass enum values. (LP: #1132976)
- Add ``__index__()`` method to support slicing. (LP: #1132972)
- Add non-deprecated ``__int__()`` method.
* Deprecate ``make()``; use ``Enum()`` instead.
- Call ``IntEnum()`` to create integer valued enums. (LP: #1162375)
- Accept a space-separate string of enum values which are auto-split.
- Accept a dictionary of enumeration name/value pairs.
* Add ``.value`` attribute to enum values. (LP: #1132859)
* For ``__getitem__()`` and ``__call__()``, fall back to using the ``.value``
attribute if the argument has one. (LP: #1124596)
* Previously deprecated APIs ``EnumValue.enumclass``, ``EnumValue.enumname``,
and ``enum.make_enum()`` are removed. (LP: #1132951)
* Small change to the ``repr`` of enum values; they now say "value=" instead
* Multiple enum values now raise a `ValueError` instead of a `TypeError`.
* Add classifiers to setup.py and make the long description more compatible
with the Cheeseshop.
* Other changes to make the Cheeseshop page look nicer. (LP: #680136)
* setup_helper.py version 2.1.
* Fix Python 3 compatibility with Sphinx's conf.py ($python setup.py install).
* Remove the dependency on 2to3 for Python 3 support; support Python 3
directly with a single code base.
* flufl.enum.make_enum() is deprecated in favor of flufl.enum.make() which
provides a better API. (LP: #839529)
* Updated to distribute 0.6.19.
* Moved all documentation to .rst suffix.
* Make test_deprecations() compatible with Python 3 and Python 2.
* Removed markup for pylint.
* Improve documentation to illustrate that enum values with similar names and
integer representations still do not hash equally. (Found by Jeroen
* make_enum() accepts an optional `iterable` argument to provide the values
for the enums.
* The .enumclass and .enumname attributes are deprecated. Use .enum and
.name instead, respectively.
* Improve the documentation regarding ordered comparisons and equality
tests. (LP: #794853)
* make_enum() now enforces the use of valid Python identifiers. (LP: #803570)
* New convenience function `make_enum()`. (Contributed by Michael Foord)
* Fix `from flufl.enum import *`.
* Enums created with the class syntax can be pickled and unpickled.
(Suggestion and basic implementation idea by Phillip Eby).
* Fixed typo which caused the package to break.
* Package renamed to flufl.enum.
* Fixed some test failures when running under 2to3.
* Fix the manifest and clarify license.
* Use Sphinx to build the documentation.
* Updates to better package Debian/Ubuntu.
* Use distribute_setup instead of ez_setup.
* Rename pep-xxxx.txt; this won't be submitted as a PEP.
* Remove dependencies on nose and setuptools_bzr
* Support Python 3 via 2to3.
Try `bzr log lp:flufl.enum` for details.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.