From 05641ff3e181c120d9094b073b4b3fde0bd5801d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mus=C3=ADlek?= Date: Sat, 13 Jul 2024 11:07:09 +0200 Subject: [PATCH 1/2] gh-121658: Add MimeTypes.add_type docs --- Doc/library/mimetypes.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index 91e8c30f8607b3..a35a3f2c0294bb 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -241,6 +241,12 @@ than one MIME-type database; it provides an interface similar to the one of the :data:`common_types` and :data:`types_map`. + .. method:: MimeTypes.add_type(type, ext, strict=True) + + Similar to the :func:`add_type` function, using the tables stored as part of + the object. + + .. method:: MimeTypes.guess_extension(type, strict=True) Similar to the :func:`guess_extension` function, using the tables stored as part From 5090fd259f64a8cd08344c63769615bc47431516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mus=C3=ADlek?= Date: Thu, 22 Aug 2024 10:20:20 +0200 Subject: [PATCH 2/2] gh-121658: Add versionadded note --- Doc/library/mimetypes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst index a35a3f2c0294bb..966d9792ecb6f0 100644 --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -246,6 +246,8 @@ than one MIME-type database; it provides an interface similar to the one of the Similar to the :func:`add_type` function, using the tables stored as part of the object. + .. versionadded:: 2.3 + .. method:: MimeTypes.guess_extension(type, strict=True)