code: def inspect_io_obj(obj):
      
      itype = guess_io_type(obj)
  
      if itype == IOI_PATH_STR:
          ipath = anyconfig.utils.normpath(obj)
          ext = anyconfig.utils.get_file_extension(ipath)
          opener = open
      elif itype == IOI_PATH_OBJ:
          ipath = anyconfig.utils.normpath(obj.as_posix())
          ext = anyconfig.utils.get_file_extension(ipath)
          opener = obj.open
      elif itype == IOI_STREAM:
          ipath = anyconfig.utils.get_path_from_stream(obj)
          ext = anyconfig.utils.get_file_extension(ipath) if ipath else None
          opener = anyconfig.utils.noop
      elif itype == IOI_NONE:
          ipath = ext = None
          opener = anyconfig.utils.noop
      else:
          raise UnknownFileTypeError("%r" % obj)
  
      return (itype, ipath, opener, ext)
docs: :param obj: a path string, a pathlib.Path or a file / file-like object
  
      :return: A tuple of (objtype, objpath, objopener)
      :raises: UnknownFileTypeError