diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2015-04-12 06:23:06 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2015-04-12 06:23:06 (GMT) |
commit | 48a724fa33143bcbab2228058d3f59e1813bd49c (patch) | |
tree | 1e5ab980434e531aa80d841c3072978c9b925f6c /Lib/enum.py | |
parent | a1c7e727c8fd9a9bf924ecc20c7d6892d19aa99e (diff) | |
download | cpython-48a724fa33143bcbab2228058d3f59e1813bd49c.zip cpython-48a724fa33143bcbab2228058d3f59e1813bd49c.tar.gz cpython-48a724fa33143bcbab2228058d3f59e1813bd49c.tar.bz2 |
Close issue23900: add default __doc__ to new enumerations that do not specify one.
Diffstat (limited to 'Lib/enum.py')
-rw-r--r-- | Lib/enum.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 1d9ebf0..c28f345 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -106,6 +106,10 @@ class EnumMeta(type): raise ValueError('Invalid enum member name: {0}'.format( ','.join(invalid_names))) + # create a default docstring if one has not been provided + if '__doc__' not in classdict: + classdict['__doc__'] = 'An enumeration.' + # create our new Enum type enum_class = super().__new__(metacls, cls, bases, classdict) enum_class._member_names_ = [] # names in definition order |