Skip to content

Commit 3e5b82e

Browse files
Small text fixes for enum.rst (#27322)
Co-authored-by: Ethan Furman <[email protected]>
1 parent 3f135c0 commit 3e5b82e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Doc/howto/enum.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ evaluate to ``True``.
508508
Pickling enums created with the functional API can be tricky as frame stack
509509
implementation details are used to try and figure out which module the
510510
enumeration is being created in (e.g. it will fail if you use a utility
511-
function in separate module, and also may not work on IronPython or Jython).
511+
function in a separate module, and also may not work on IronPython or Jython).
512512
The solution is to specify the module name explicitly as follows::
513513

514514
>>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)
@@ -540,7 +540,7 @@ The complete signature is::
540540

541541
:value: What the new enum class will record as its name.
542542

543-
:names: The enum members. This can be a whitespace or comma separated string
543+
:names: The enum members. This can be a whitespace- or comma-separated string
544544
(values will start at 1 unless otherwise specified)::
545545

546546
'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'
@@ -997,7 +997,7 @@ Plain :class:`Enum` classes always evaluate as :data:`True`.
997997
"""""""""""""""""""""""""""""
998998

999999
If you give your enum subclass extra methods, like the `Planet`_
1000-
class above, those methods will show up in a :func:`dir` of the member,
1000+
class below, those methods will show up in a :func:`dir` of the member,
10011001
but not of the class::
10021002

10031003
>>> dir(Planet)
@@ -1083,7 +1083,7 @@ the following are true:
10831083
>>> Color(0)
10841084
Color.BLACK
10851085

1086-
- membership / containment checking has changed slightly -- zero valued flags
1086+
- membership / containment checking has changed slightly -- zero-valued flags
10871087
are never considered to be contained::
10881088

10891089
>>> Color.BLACK in Color.WHITE
@@ -1152,7 +1152,7 @@ that can be used directly, or as examples for creating one's own.
11521152
Omitting values
11531153
^^^^^^^^^^^^^^^
11541154

1155-
In many use-cases one doesn't care what the actual value of an enumeration
1155+
In many use-cases, one doesn't care what the actual value of an enumeration
11561156
is. There are several ways to define this type of simple enumeration:
11571157

11581158
- use instances of :class:`auto` for the value
@@ -1338,7 +1338,7 @@ alias::
13381338
Planet
13391339
^^^^^^
13401340

1341-
If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member
1341+
If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum member
13421342
will be passed to those methods::
13431343

13441344
>>> class Planet(Enum):
@@ -1388,8 +1388,9 @@ An example to show the :attr:`_ignore_` attribute in use::
13881388
Conforming input to Flag
13891389
^^^^^^^^^^^^^^^^^^^^^^^^
13901390

1391-
Creating a :class:`Flag` enum that is more resilient out-of-bounds results to
1392-
mathematical operations, you can use the :attr:`FlagBoundary.CONFORM` setting::
1391+
To create a :class:`Flag` enum that is more resilient to out-of-bounds results
1392+
from mathematical operations, you can use the :attr:`FlagBoundary.CONFORM`
1393+
setting::
13931394

13941395
>>> from enum import Flag, CONFORM, auto
13951396
>>> class Weekday(Flag, boundary=CONFORM):

0 commit comments

Comments
 (0)