[Python-checkins] cpython: Added rationale for defaulting to 1 in the functional API.

ethan.furman python-checkins at python.org
Sat Jun 29 04:37:29 CEST 2013


http://hg.python.org/cpython/rev/852c90008881
changeset:   84364:852c90008881
user:        Ethan Furman <ethan at stoneleaf.us>
date:        Fri Jun 28 19:37:17 2013 -0700
summary:
  Added rationale for defaulting to 1 in the functional API.

files:
  Doc/library/enum.rst |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -335,6 +335,10 @@
     ...   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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list