diff -r 34881ee3eec5 Doc/library/enum.rst --- a/Doc/library/enum.rst Mon Jun 16 11:14:47 2014 -0500 +++ b/Doc/library/enum.rst Thu Jun 19 16:19:25 2014 -0700 @@ -579,22 +579,21 @@ Avoids having to specify the value for e ... green = () ... blue = () ... >>> Color.green.value == 2 True .. note:: The :meth:`__new__` method, if defined, is used during creation of the Enum members; it is then replaced by Enum's :meth:`__new__` which is used after - class creation for lookup of existing members. Due to the way Enums are - supposed to behave, there is no way to customize Enum's :meth:`__new__`. + class creation for lookup of existing members. OrderedEnum ^^^^^^^^^^^ An ordered enumeration that is not based on :class:`IntEnum` and so maintains the normal :class:`Enum` invariants (such as not being comparable to other enumerations):: >>> class OrderedEnum(Enum): @@ -736,14 +735,18 @@ Likewise, the :attr:`__members__` is onl If you give your :class:`Enum` subclass extra methods, like the `Planet`_ class above, those methods will show up in a :func:`dir` of the member, but not of the class:: >>> dir(Planet) ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] >>> dir(Planet.EARTH) ['__class__', '__doc__', '__module__', 'name', 'surface_gravity', 'value'] -A :meth:`__new__` method will only be used for the creation of the -:class:`Enum` members -- after that it is replaced. This means if you wish to -change how :class:`Enum` members are looked up you either have to write a -helper function or a :func:`classmethod`. +The :meth:`__new__` method will only be used for the creation of the +:class:`Enum` members -- after that it is replaced. Any custom :meth:`__new__` +method must create the object and set the :attr:`_value_` attribute +appropriately. + +If you wish to change how :class:`Enum` members are looked up you should either +write a helper function or a :func:`classmethod` for the :class:`Enum` +subclass.