[issue23900] Add a default docstring to Enum subclasses

2015-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be don't add __doc__ if sys.flags.optimize >= 2?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23900] Add a default docstring to Enum subclasses

2015-04-11 Thread Roundup Robot

Roundup Robot added the comment:

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

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23900] Add a default docstring to Enum subclasses

2015-04-11 Thread Ethan Furman

Ethan Furman added the comment:

We could do something like:

'An enumeration.'

and perhaps even something like:

'An enumeration based on .'

It's not much, but is better than the obviously wrong generic version.

--
assignee:  -> ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23900] Add a default docstring to Enum subclasses

2015-04-09 Thread Nick Coghlan

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com