]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added rationale for defaulting to 1 in the functional API.
authorEthan Furman <ethan@stoneleaf.us>
Sat, 29 Jun 2013 02:37:17 +0000 (19:37 -0700)
committerEthan Furman <ethan@stoneleaf.us>
Sat, 29 Jun 2013 02:37:17 +0000 (19:37 -0700)
Doc/library/enum.rst

index 89791819f6e8575c1e11e598b6ab58054e26d039..b919bdc83970c838b4fdbf56caad61e27be51ff2 100644 (file)
@@ -335,6 +335,10 @@ assignment to :class:`Animal` is equivalent to::
     ...   cat = 3
     ...   dog = 4
 
+The reason for defaulting to ``1`` as the starting number and not ``0`` is
+that ``0`` is ``False`` in a boolean sense, but enum members all evaluate
+to ``True``.
+
 Pickling enums created with the functional API can be tricky as frame stack
 implementation details are used to try and figure out which module the
 enumeration is being created in (e.g. it will fail if you use a utility