[Python-checkins] cpython: standardize Enum docs by referring to 'special methods' instead of __dunder__

ethan.furman python-checkins at python.org
Sat Nov 1 15:40:47 CET 2014


https://hg.python.org/cpython/rev/149490bbd260
changeset:   93331:149490bbd260
user:        Ethan Furman <ethan at stoneleaf.us>
date:        Sat Nov 01 07:40:22 2014 -0700
summary:
  standardize Enum docs by referring to 'special methods' instead of __dunder__ methods

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


diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -314,11 +314,11 @@
     >>> str(Mood.funky)
     'my custom str! 1'
 
-The rules for what is allowed are as follows: _sunder_ names (starting and
-ending with a single underscore) are reserved by enum and cannot be used;
-all other attributes defined within an enumeration will become members of this
-enumeration, with the exception of *__dunder__* names and descriptors (methods
-are also descriptors).
+The rules for what is allowed are as follows: names that start and end with a
+with a single underscore are reserved by enum and cannot be used; all other
+attributes defined within an enumeration will become members of this
+enumeration, with the exception of special methods (:meth:`__str__`,
+:meth:`__add__`, etc.) and descriptors (methods are also descriptors).
 
 Note:  if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then
 whatever value(s) were given to the enum member will be passed into those

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


More information about the Python-checkins mailing list