'Generate documentation for an object.'

def document(self, object, name=None, *args):

    args = ((object, name) + args)
    if inspect.isgetsetdescriptor(object):
        return self.docdata(*args)
    if inspect.ismemberdescriptor(object):
        return self.docdata(*args)
    try:
        if inspect.ismodule(object):
            return self.docmodule(*args)
        if inspect.isclass(object):
            return self.docclass(*args)
        if inspect.isroutine(object):
            return self.docroutine(*args)
    except AttributeError:
        pass
    if isinstance(object, property):
        return self.docproperty(*args)
    return self.docother(*args)
