autoclasstoc.utils.get_cls_xref

autoclasstoc.utils.get_cls_xref(cls, cant_import=None)[source]

Return a RST-formatted string that references the given class.

The purpose of this function is to handle the special case where the class in question can’t be imported. Currently, this case is checked for using a simple heuristic: whether the class’s qualified name includes any local namespaces. If this is the case, the return value can be chosen to avoid triggering any Sphinx/autodoc errors and to produce output that is at least reasonable.