From 9c82297e9b0820eeb1e3b224b26ab78067da5899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20M=C4=83r=C4=83=C8=99teanu?= Date: Mon, 24 Nov 2025 21:50:40 +0000 Subject: [PATCH] fix(`mimetypes`): update init functions to accept `Iterable`s of file paths --- stdlib/mimetypes.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index 1f5e01e2f221..2390b2ce39f8 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import StrPath -from collections.abc import Sequence +from collections.abc import Iterable from typing import IO __all__ = [ @@ -25,7 +25,7 @@ if sys.version_info >= (3, 13): def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... def guess_extension(type: str, strict: bool = True) -> str | None: ... -def init(files: Sequence[StrPath] | None = None) -> None: ... +def init(files: Iterable[StrPath] | None = None) -> None: ... def read_mime_types(file: StrPath) -> dict[str, str] | None: ... def add_type(type: str, ext: str, strict: bool = True) -> None: ... @@ -44,7 +44,7 @@ class MimeTypes: encodings_map: dict[str, str] types_map: tuple[dict[str, str], dict[str, str]] types_map_inv: tuple[dict[str, str], dict[str, str]] - def __init__(self, filenames: tuple[StrPath, ...] = (), strict: bool = True) -> None: ... + def __init__(self, filenames: Iterable[StrPath] = (), 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]: ...