mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-07 05:54:02 +08:00
[mimetypes] update init functions to accept Iterables of file paths (#15079)
This commit is contained in:
committed by
GitHub
parent
281be89d67
commit
6f7cecb63c
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user