Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stdlib/mimetypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ 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[str] | None = None) -> None: ...
def read_mime_types(file: str) -> dict[str, str] | None: ...
def init(files: Sequence[StrPath] | None = None) -> None: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def read_mime_types(file: StrPath) -> dict[str, str] | None: ...
def add_type(type: str, ext: str, strict: bool = True) -> None: ...

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

inited: bool
knownfiles: list[str]
knownfiles: list[StrPath]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suffix_map: dict[str, str]
encodings_map: dict[str, str]
types_map: dict[str, str]
Expand All @@ -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[str, ...] = (), strict: bool = True) -> None: ...
def __init__(self, filenames: tuple[StrPath, ...] = (), strict: bool = True) -> None: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it just works.

As a side note -- is there a particular reason why init accepts a Sequence of names, but MimeTypes.__init__ only a tuple? I mean other than it being initialised that way. It's working with either tuple or list.

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]: ...
Expand Down
Loading