Skip to content

Commit d52726c

Browse files
Document mimetypes.MimeTypes.add_type() (#122301)
Co-authored-by: Adam Turner <[email protected]>
1 parent 33586d6 commit d52726c

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)