Commit 93d7dda9 authored by Ezio Melotti's avatar Ezio Melotti

#19148: fix markup errors and wording in enum docs. Patch by Esa Peuha.

parent a3494785
...@@ -250,7 +250,7 @@ Equality comparisons are defined though:: ...@@ -250,7 +250,7 @@ Equality comparisons are defined though::
True True
Comparisons against non-enumeration values will always compare not equal Comparisons against non-enumeration values will always compare not equal
(again, class:`IntEnum` was explicitly designed to behave differently, see (again, :class:`IntEnum` was explicitly designed to behave differently, see
below):: below)::
>>> Color.blue == 2 >>> Color.blue == 2
...@@ -594,8 +594,8 @@ alias:: ...@@ -594,8 +594,8 @@ alias::
.. note:: .. note::
This is a useful example for subclassing Enum to add or change other This is a useful example for subclassing Enum to add or change other
behaviors as well as disallowing aliases. If the only change desired is behaviors as well as disallowing aliases. If the only desired change is
no aliases allowed the :func:`unique` decorator can be used instead. disallowing aliases the :func:`unique` decorator can be used instead.
Planet Planet
...@@ -671,11 +671,11 @@ the member:: ...@@ -671,11 +671,11 @@ the member::
... ...
AttributeError: 'Color' object has no attribute 'blue' AttributeError: 'Color' object has no attribute 'blue'
Likewise, the :attr:`__members__` is only available on the class. Likewise, the :attr:`__members__` is only available on the class.
If you give your :class:`Enum` subclass extra methods, like the `Planet`_ 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, class above, those methods will show up in a :func:`dir` of the member,
but not of the class:: but not of the class::
>>> dir(Planet) >>> dir(Planet)
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__']
......
...@@ -988,6 +988,7 @@ Chris Petrilli ...@@ -988,6 +988,7 @@ Chris Petrilli
Roumen Petrov Roumen Petrov
Bjorn Pettersen Bjorn Pettersen
Justin D. Pettit Justin D. Pettit
Esa Peuha
Ronny Pfannschmidt Ronny Pfannschmidt
Geoff Philbrick Geoff Philbrick
Gavrie Philipson Gavrie Philipson
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment