lp:~barry/flufl.enum/lp1162375
- Get this branch:
- bzr branch lp:~barry/flufl.enum/lp1162375
Branch merges
- Barry Warsaw: Pending requested
-
Diff: 423 lines (+91/-109)7 files modifiedREADME.rst (+3/-3)
flufl/enum/NEWS.rst (+2/-1)
flufl/enum/README.rst (+12/-8)
flufl/enum/__init__.py (+1/-2)
flufl/enum/_enum.py (+12/-13)
flufl/enum/docs/using.rst (+33/-50)
flufl/enum/tests/test_enum.py (+28/-32)
Related bugs
Bug #1162375: Use calling syntax on Enum/IntEnum instead of make() | High | Fix Released |
Related blueprints
Branch information
Recent revisions
- 76. By Barry Warsaw
-
- Deprecate make().
- Remove make_int() since it was never released.
- Deprecate 1-arg Enum() calling.
- Co-opt Enum() and IntEnum() as the functional API for creating enums. - 73. By Barry Warsaw
-
Prepare for the 3.4 release (and PEP 345).
* Deprecate ``EnumValue.
__int__ ()``; use ``IntEnumValue`` (via ``IntEnum``)
instead.
* Add ``IntEnum`` class which returns int-subclass enum values. (LP: #1132976)
- Add ``__index__()`` method to support slicing. (LP: #1132972)
- Add non-deprecated ``__int__()`` method.
- Add `make_int()` convenience function.
* 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)Also:
* Add secret ``__value_
factory_ _`` attribute to specify a different class for
the enum values. This is what ``IntEnum`` uses.
* bzr ignore __pycache__ directories.
* Add a simple tox configuration file.
* Bump copyright years. - 71. By Barry Warsaw
-
* For ``__getitem__()`` and ``__call__()``, try to coerce the argument to an
int to support "integer-ish" arguments, such as an ``EnumValue``.
(LP: #1124596) - 70. By Barry Warsaw
-
* Add ``__index__()`` method to support slicing. (LP: #1132972)
Also, remove an unused import.
- 69. By Barry Warsaw
-
* Previously deprecated APIs ``EnumValue.
enumclass` `, ``EnumValue. enumname` `,
and ``enum.make_enum( )`` are removed. (LP: #1132951)
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:~barry/flufl.enum/trunk