Skip to content

Commit 8dcca56

Browse files
authored
[mimetypes] Functions working with files accept Paths (#15071)
1 parent fbcce8e commit 8dcca56

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/mimetypes.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ if sys.version_info >= (3, 13):
2525
def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ...
2626
def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ...
2727
def guess_extension(type: str, strict: bool = True) -> str | None: ...
28-
def init(files: Sequence[str] | None = None) -> None: ...
29-
def read_mime_types(file: str) -> dict[str, str] | None: ...
28+
def init(files: Sequence[StrPath] | None = None) -> None: ...
29+
def read_mime_types(file: StrPath) -> dict[str, str] | None: ...
3030
def add_type(type: str, ext: str, strict: bool = True) -> None: ...
3131

3232
if sys.version_info >= (3, 13):
3333
def guess_file_type(path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ...
3434

3535
inited: bool
36-
knownfiles: list[str]
36+
knownfiles: list[StrPath]
3737
suffix_map: dict[str, str]
3838
encodings_map: dict[str, str]
3939
types_map: dict[str, str]
@@ -44,12 +44,12 @@ class MimeTypes:
4444
encodings_map: dict[str, str]
4545
types_map: tuple[dict[str, str], dict[str, str]]
4646
types_map_inv: tuple[dict[str, str], dict[str, str]]
47-
def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ...
47+
def __init__(self, filenames: tuple[StrPath, ...] = (), strict: bool = True) -> None: ...
4848
def add_type(self, type: str, ext: str, strict: bool = True) -> None: ...
4949
def guess_extension(self, type: str, strict: bool = True) -> str | None: ...
5050
def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ...
5151
def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ...
52-
def read(self, filename: str, strict: bool = True) -> None: ...
52+
def read(self, filename: StrPath, strict: bool = True) -> None: ...
5353
def readfp(self, fp: IO[str], strict: bool = True) -> None: ...
5454
def read_windows_registry(self, strict: bool = True) -> None: ...
5555
if sys.version_info >= (3, 13):

0 commit comments

Comments
 (0)