[docs] Code, test, and doc review for PEP-0435 Enum (issue 17947)

zachary.ware at gmail.com zachary.ware at gmail.com
Mon Jun 10 07:00:12 CEST 2013


A few nitpicks and a suggestion.  Everything else looks good to me.


http://bugs.python.org/review/17947/diff/8339/Doc/library/enum.rst
File Doc/library/enum.rst (right):

http://bugs.python.org/review/17947/diff/8339/Doc/library/enum.rst#newcode60
Doc/library/enum.rst:60: Enums also have a property that contains just
their item name::
Conflict with the note on nomenclature above; should be 'Enum members
...'.

http://bugs.python.org/review/17947/diff/8339/Doc/library/enum.rst#newcode314
Doc/library/enum.rst:314: >>> Animals = Enum('Animals', 'ant bee cat
dog', module=__name__)
This bit about pickling should be at the end of this section (just as
the 'module' argument is last in the call).

http://bugs.python.org/review/17947/diff/8339/Doc/library/enum.rst#newcode337
Doc/library/enum.rst:337: A variation of :class:`Enum` is proposed which
is also a subclass of
s/proposed/provided/

http://bugs.python.org/review/17947/diff/8339/Doc/library/enum.rst#newcode423
Doc/library/enum.rst:423: One frequent request is to not have to specify
values for enum members::
The obvious thing that comes to mind when reading "One frequent request"
or "Some have asked...", etc., is "Then why are these not provided in
the module?"  I wonder if it might be better to wrap these examples up
into a demo file for Tools/demo, and shorten this section to "Some
interesting Enum subclasses can be found in the Tools/demo folder of
your Python installation or source distribution."

Alternately, I'd advise finding a different wording, though I
unfortunately can't come up with any myself.

http://bugs.python.org/review/17947/diff/8339/Lib/test/test_enum.py
File Lib/test/test_enum.py (right):

http://bugs.python.org/review/17947/diff/8339/Lib/test/test_enum.py#newcode474
Lib/test/test_enum.py:474: _reserved_ = 0
This test is covered by test_invalid_names above.

http://bugs.python.org/review/17947/


More information about the docs mailing list