Skip to content

Commit 4fa46cf

Browse files
miss-islingtonnegativenageshAA-Turner
authored
[3.13] Document mimetypes.MimeTypes.add_type() (GH-122301) (#122328)
Document ``mimetypes.MimeTypes.add_type()`` (GH-122301) (cherry picked from commit d52726c) Co-authored-by: Subrahmanya Gaonkar <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent 9d5dde5 commit 4fa46cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/library/mimetypes.rst

+10
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,13 @@ than one MIME-type database; it provides an interface similar to the one of the
295295
types, else to the list of non-standard types.
296296

297297
.. versionadded:: 3.2
298+
299+
300+
.. method:: MimeTypes.add_type(type, ext, strict=True)
301+
302+
Add a mapping from the MIME type *type* to the extension *ext*. When the
303+
extension is already known, the new type will replace the old one. When the type
304+
is already known the extension will be added to the list of known extensions.
305+
306+
When *strict* is ``True`` (the default), the mapping will be added to the
307+
official MIME types, otherwise to the non-standard ones.

0 commit comments

Comments
 (0)