code: def inspect(object):
      
      for k in dir(object):
          try:
              details = getattr(object, k)
          except Exception as e:
              details = e
  
          try:
              details = str(details)
          except Exception as e:
              details = e
  
          print("{}: {}".format(k, details), file=sys.stderr)
docs: A better dir() showing attributes and values