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

Function describe

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

Produce a short description of the given thing.

(thing)

Source from the content-addressed store, hash-verified

1768 sys.stdout.write(plain(_escape_stdout(text)))
1769
1770def describe(thing):
1771 """Produce a short description of the given thing."""
1772 if inspect.ismodule(thing):
1773 if thing.__name__ in sys.builtin_module_names:
1774 return 'built-in module ' + thing.__name__
1775 if hasattr(thing, '__path__'):
1776 return 'package ' + thing.__name__
1777 else:
1778 return 'module ' + thing.__name__
1779 if inspect.isbuiltin(thing):
1780 return 'built-in function ' + thing.__name__
1781 if inspect.isgetsetdescriptor(thing):
1782 return 'getset descriptor %s.%s.%s' % (
1783 thing.__objclass__.__module__, thing.__objclass__.__name__,
1784 thing.__name__)
1785 if inspect.ismemberdescriptor(thing):
1786 return 'member descriptor %s.%s.%s' % (
1787 thing.__objclass__.__module__, thing.__objclass__.__name__,
1788 thing.__name__)
1789 if inspect.isclass(thing):
1790 return 'class ' + thing.__name__
1791 if inspect.isfunction(thing):
1792 return 'function ' + thing.__name__
1793 if inspect.ismethod(thing):
1794 return 'method ' + thing.__name__
1795 return type(thing).__name__
1796
1797def locate(path, forceload=0):
1798 """Locate an object by name or dotted path, importing as necessary."""

Callers 3

render_docFunction · 0.85
writedocFunction · 0.85
html_getobjFunction · 0.85

Calls 1

typeClass · 0.50

Tested by

no test coverage detected