Path 1: 2137 calls (1.0)

dict (301) list (232) 1 (199) (1,) (94) ('Paul Atreides', 'Vladimir Harkonnen', 'Thufir Hawat') (90) (False, True, None) (90) [1, 2, 3] (74) 2 (54) tu...

tuple def (599) tuple (480) ABCMeta (200) Node def (170) array def (104) defaultdict def (103) Counter def (102) deque def (102) dict def (102) frozen...

False (1722) True (415)

1def _safe_isinstance(
2    obj: object, class_or_tuple: Union[type, Tuple[type, ...]]
3) -> bool:
4    """isinstance can fail in rare cases, for example types with no __class__"""
5    try:
6        return isinstance(obj, class_or_tuple)
7    except Exception:
8        return False
            

Path 2: 2 calls (0.0)

test_inspect_swig_edge_case..Thing (2)

tuple (2)

False (2)

AttributeError (2)

1def _safe_isinstance(
2    obj: object, class_or_tuple: Union[type, Tuple[type, ...]]
3) -> bool:
4    """isinstance can fail in rare cases, for example types with no __class__"""
5    try:
6        return isinstance(obj, class_or_tuple)
7    except Exception:
8        return False