code: def inspect(item, maxchar=80):
      
      for i in dir(item):
          try:
              member = str(getattr(item, i))
              if maxchar and len(member) > maxchar:
                  member = member[:maxchar] + "..."
          except:
              member = "[ERROR]"
          print("{}: {}".format(i, member), file=sys.stderr)
docs: Inspect the attributes of an item.