Checks if obj is an instance of module.class_name if loaded
(obj, module, class_name, *attrs)
| 1709 | |
| 1710 | |
| 1711 | def _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() |
no outgoing calls
no test coverage detected
searching dependent graphs…