New submission from Nick Coghlan:

Issue #15582 added docstring inheritance to the inspect module. This means that 
Enum subclasses without their own docstring now inherit the generic docstring 
from the base class definition:

>>> import enum, inspect
>>> class MyEnum(enum.Enum):
...   a = 1
... 
>>> inspect.getdoc(MyEnum)
'Generic enumeration.\n\nDerive from this class to define new enumerations.'

Perhaps the metaclass could automatically derive a more suitable docstring if 
the subclass doesn't set one of its own?

----------
messages: 240348
nosy: barry, eli.bendersky, ethan.furman, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a default docstring to Enum subclasses
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23900>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to