pandas/io/excel/_base.py
def check_extension(cls, ext: str):
        """
        checks that path's extension against the Writer's supported
        extensions.  If it isn't supported, raises UnsupportedFiletypeError.
        """
        if ext.startswith("."):
            ext = ext[1:]
        # error: "Callable[[ExcelWriter], Any]" has no attribute "__iter__"
        #  (not iterable)  [attr-defined]
        if not any(
            ext in extension
            for extension in cls.supported_extensions  # type: ignore[attr-defined]
        ):
            raise ValueError(f"Invalid extension for engine '{cls.engine}': '{ext}'")
        else:
            return True

        checks that path's extension against the Writer's supported
        extensions.  If it isn't supported, raises UnsupportedFiletypeError.
        
checks that path's extension against the Writer's supported
extensions.  If it isn't supported, raises UnsupportedFiletypeError.
checks that path ' s extension against the Writer ' s supported extensions . If it isn ' t supported raises UnsupportedFiletypeError .
def check_extension(cls, ext: str):
        if ext.startswith("."):
            ext = ext[1:]
        if not any(
            ext in extension
            for extension in cls.supported_extensions  
        ):
            raise ValueError(f"Invalid extension for engine '{cls.engine}': '{ext}'")
        else:
            return True
def check_extension ( cls , ext : str ) : if ext . startswith ( "." ) : ext = ext [ 1 : ] if not any ( ext in extension for extension in cls . supported_extensions ) : raise ValueError ( f"Invalid extension for engine '{cls.engine}': '{ext}'" ) else : return True
checks that path's extension against the Writer's supported
extensions.
checks that path ' s extension against the Writer ' s supported extensions .
"""
        checks that path's extension against the Writer's supported
        extensions.  If it isn't supported, raises UnsupportedFiletypeError.
        """ # error: "Callable[[ExcelWriter], Any]" has no attribute "__iter__" #  (not iterable)  [attr-defined] # type: ignore[attr-defined]
cls
ext
str