This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年04月09日 16:42 by ncoghlan, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg240348 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2015年04月09日 16:42 | |
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? |
|||
| msg240486 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2015年04月11日 16:47 | |
We could do something like: 'An enumeration.' and perhaps even something like: 'An enumeration based on <int>.' It's not much, but is better than the obviously wrong generic version. |
|||
| msg240545 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年04月12日 06:23 | |
New changeset 684aadcabcc7 by Ethan Furman in branch 'default': Close issue23900: add default __doc__ to new enumerations that do not specify one. https://hg.python.org/cpython/rev/684aadcabcc7 |
|||
| msg240856 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年04月14日 08:03 | |
May be don't add __doc__ if sys.flags.optimize >= 2? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:15 | admin | set | github: 68088 |
| 2015年04月14日 08:03:04 | serhiy.storchaka | set | messages: + msg240856 |
| 2015年04月12日 06:23:24 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg240545 resolution: fixed stage: needs patch -> resolved |
| 2015年04月11日 16:47:07 | ethan.furman | set | assignee: ethan.furman messages: + msg240486 |
| 2015年04月09日 16:42:37 | ncoghlan | create | |