code: def test_inspect_swig_edge_case():
      """Issue #1838 - Edge case with Faiss library - object with empty dir()"""
  
      class Thing:
          @property
          def __class__(self):
              raise AttributeError
  
      thing = Thing()
      try:
          inspect(thing)
      except Exception as e:
          assert False, f"Object with no __class__ shouldn't raise {e}"
  
imports: import io
  import sys
  from types import ModuleType
  from typing import Sequence, Type
  import pytest
  from rich import inspect
  from rich._inspect import get_object_types_mro, get_object_types_mro_as_strings, is_object_one_of_types
  from rich.console import Console
label_desc: Use image node_id 14 for calling a global function with example usage: test_inspect_swig_edge_case() without return types