MCPcopy Index your code
hub / github.com/RustPython/RustPython / parentname

Function parentname

Lib/pydoc.py:244–255  ·  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

242 return name
243
244def parentname(object, modname):
245 """Get a name of the enclosing class (qualified it with a module name
246 if necessary) or module."""
247 if '.' in object.__qualname__:
248 name = object.__qualname__.rpartition('.')[0]
249 if object.__module__ != modname and object.__module__ is not None:
250 return object.__module__ + '.' + name
251 else:
252 return name
253 else:
254 if object.__module__ != modname:
255 return object.__module__
256
257def isdata(object):
258 """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.45

Tested by

no test coverage detected