MCPcopy Index your code
hub / github.com/RustPython/RustPython / add_type

Function add_type

Lib/mimetypes.py:388–402  ·  view source on GitHub ↗

Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of sta

(type, ext, strict=True)

Source from the content-addressed store, hash-verified

386 return _db.guess_extension(type, strict)
387
388def add_type(type, ext, strict=True):
389 """Add a mapping between a type and an extension.
390
391 When the extension is already known, the new
392 type will replace the old one. When the type
393 is already known the extension will be added
394 to the list of known extensions.
395
396 If strict is true, information will be added to
397 list of standard types, else to the list of non-standard
398 types.
399 """
400 if _db is None:
401 init()
402 return _db.add_type(type, ext, strict)
403
404
405def init(files=None):

Callers 1

Calls 2

add_typeMethod · 0.80
initFunction · 0.70

Tested by

no test coverage detected