1+ import sys
12from _typeshed import StrPath
23from collections .abc import Sequence
34from typing import IO
@@ -18,13 +19,19 @@ __all__ = [
1819 "common_types" ,
1920]
2021
22+ if sys .version_info >= (3 , 13 ):
23+ __all__ += ["guess_file_type" ]
24+
2125def guess_type (url : StrPath , strict : bool = True ) -> tuple [str | None , str | None ]: ...
2226def guess_all_extensions (type : str , strict : bool = True ) -> list [str ]: ...
2327def guess_extension (type : str , strict : bool = True ) -> str | None : ...
2428def init (files : Sequence [str ] | None = None ) -> None : ...
2529def read_mime_types (file : str ) -> dict [str , str ] | None : ...
2630def add_type (type : str , ext : str , strict : bool = True ) -> None : ...
2731
32+ if sys .version_info >= (3 , 13 ):
33+ def guess_file_type (path : StrPath , * , strict : bool = True ) -> tuple [str | None , str | None ]: ...
34+
2835inited : bool
2936knownfiles : list [str ]
3037suffix_map : dict [str , str ]
@@ -44,3 +51,5 @@ class MimeTypes:
4451 def read (self , filename : str , strict : bool = True ) -> None : ...
4552 def readfp (self , fp : IO [str ], strict : bool = True ) -> None : ...
4653 def read_windows_registry (self , strict : bool = True ) -> None : ...
54+ if sys .version_info >= (3 , 13 ):
55+ def guess_file_type (self , path : StrPath , * , strict : bool = True ) -> tuple [str | None , str | None ]: ...
0 commit comments