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

Function parentname

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

Get a name of the enclosing class (qualified it with a module name if necessary) or module.

(object, modname)

Source from the content-addressed store, hash-verified

205 return name
206
207def parentname(object, modname):
208 """Get a name of the enclosing class (qualified it with a module name
209 if necessary) or module."""
210 if '.' in object.__qualname__:
211 name = object.__qualname__.rpartition('.')[0]
212 if object.__module__ != modname:
213 return object.__module__ + '.' + name
214 else:
215 return name
216 else:
217 if object.__module__ != modname:
218 return object.__module__
219
220def isdata(object):
221 """Check if an object is of a type that probably means it's data."""

Callers 2

parentlinkMethod · 0.85
docroutineMethod · 0.85

Calls 1

rpartitionMethod · 0.80

Tested by

no test coverage detected