code: def extract_type(s):
      
      r = re.compile(r"<class '(.*)'>", re.MULTILINE | re.IGNORECASE)
      try:
          m = r.match(str(s)).group(1)
      except (IndexError, AttributeError) as e:
          m = None
  
      return m
docs: Extract the type string from str(type(obj)) to remove the "<class..." bit.