From 1eb6e223f43ffac3ce002102bce368e4aad2a716 Mon Sep 17 00:00:00 2001 From: Kirill Podoprigora Date: Sat, 13 Jul 2024 11:29:46 +0300 Subject: [PATCH] Add ``MimeTypes.add_types`` method (#12329) --- stdlib/@tests/stubtest_allowlists/common.txt | 1 - stdlib/mimetypes.pyi | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 6fc81bc8e..8d28fbda3 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -202,7 +202,6 @@ ctypes.ARRAY ctypes.SetPointerType ctypes.c_voidp ctypes.util.test -mimetypes.MimeTypes.add_type modulefinder.test multiprocessing.managers.Server.accepter multiprocessing.managers.Server.create diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index 517193e35..9914a34a2 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -45,6 +45,7 @@ class MimeTypes: types_map: tuple[dict[str, str], dict[str, str]] types_map_inv: tuple[dict[str, str], dict[str, str]] def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ... + def add_type(self, type: str, ext: str, strict: bool = True) -> None: ... def guess_extension(self, type: str, strict: bool = True) -> str | None: ... def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ...