MCPcopy Index your code
hub / github.com/ipython/ipython / _safe_isinstance

Function _safe_isinstance

IPython/core/completer.py:1711–1718  ·  view source on GitHub ↗

Checks if obj is an instance of module.class_name if loaded

(obj, module, class_name, *attrs)

Source from the content-addressed store, hash-verified

1709
1710
1711def _safe_isinstance(obj, module, class_name, *attrs):
1712 """Checks if obj is an instance of module.class_name if loaded
1713 """
1714 if module in sys.modules:
1715 m = sys.modules[module]
1716 for attr in [class_name, *attrs]:
1717 m = getattr(m, attr)
1718 return isinstance(obj, m)
1719
1720
1721@context_matcher()

Callers 1

_get_keysMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…