[Python-ideas] inheriting docstrings and mutable docstings for classes
Dj Gilcrease
digitalxero at gmail.com
Fri Jun 10 15:29:18 CEST 2011
More information about the Python-ideas mailing list
Fri Jun 10 15:29:18 CEST 2011
- Previous message: [Python-ideas] inheriting docstrings and mutable docstings for classes
- Next message: [Python-ideas] inheriting docstrings and mutable docstings for classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jun 10, 2011 at 3:28 AM, Arnaud Delobelle <arnodel at gmail.com> wrote: > Given that Python supports multiple inheritance, which parent class's > __doc__ would the __basedoc__ contain? Also, what would the > __basedoc__ contain if the parent's __doc__ is empty but not its > __basedoc__? You would not need a __basedoc__ magic attribute, you can just do class C(object): pass docs = [c.__doc__ for c in C.__mro__] and you get the docs for all bases in the proper mro order Though I guess __basedocs__ mapping to [c.__doc__ for c in C.__mro__ if c != C] could be handy
- Previous message: [Python-ideas] inheriting docstrings and mutable docstings for classes
- Next message: [Python-ideas] inheriting docstrings and mutable docstings for classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list