MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / parentlink

Method parentlink

tools/python-3.11.9-amd64/Lib/pydoc.py:671–688  ·  view source on GitHub ↗

Make a link for the enclosing class or module.

(self, object, modname)

Source from the content-addressed store, hash-verified

669 return classname(object, modname)
670
671 def parentlink(self, object, modname):
672 """Make a link for the enclosing class or module."""
673 link = None
674 name, module = object.__name__, sys.modules.get(object.__module__)
675 if hasattr(module, name) and getattr(module, name) is object:
676 if '.' in object.__qualname__:
677 name = object.__qualname__.rpartition('.')[0]
678 if object.__module__ != modname:
679 link = '%s.html#%s' % (module.__name__, name)
680 else:
681 link = '#%s' % name
682 else:
683 if object.__module__ != modname:
684 link = '%s.html' % module.__name__
685 if link:
686 return '<a href="%s">%s</a>' % (link, parentname(object, modname))
687 else:
688 return parentname(object, modname)
689
690 def modulelink(self, object):
691 """Make a link for a module."""

Callers 1

docroutineMethod · 0.95

Calls 3

parentnameFunction · 0.85
rpartitionMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected