10 Jun
2011
10 Jun
'11
8:29 a.m.
On Fri, Jun 10, 2011 at 3:28 AM, Arnaud Delobelle
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