def _fill_inheritance(self):
mro = filter(lambda c: c != self and isinstance(c, Class),<EOL>self.module.mro(self))<EOL>def search(d, fdoc):<EOL><INDENT>for c in mro:<EOL><INDENT>doc = fdoc(c)<EOL>if d.name in doc and isinstance(d, type(doc[d.name])):<EOL><INDENT>return doc[d.name]<EOL><DEDENT><DEDENT>return None<EOL><DEDENT>for fdoc in (lambda c: c.doc_init, lambda c: c.doc):<EOL><INDENT>for d in fdoc(self).values():<EOL><INDENT>dinherit = search(d, fdoc)<EOL>if dinherit is not None:<EOL><INDENT>d.inherits = dinherit<EOL><DEDENT><DEDENT><DEDENT>for c in mro:<EOL><INDENT>for name in filter(lambda n: n not in self.doc_init, c.doc_init):<EOL><INDENT>d = c.doc_init[name]<EOL>self.doc_init[name] = Variable(d.name, d.module, '<STR_LIT>', cls=self)<EOL>self.doc_init[name].inherits = d<EOL><DEDENT><DEDENT>
Traverses this class's ancestor list and attempts to fill in
missing documentation from its ancestor's documentation.

The first pass connects variables, methods and functions with
their inherited couterparts. (The templates will decide how to
display docstrings.) The second pass attempts to add instance
variables to this class that were only explicitly declared in
a parent class. This second pass is necessary since instance
variables are only discoverable by traversing the abstract
syntax tree.