[Python-Dev] mimetypes patch #554192
Fri, 16 Aug 2002 13:35:41 +0200
Barry A. Warsaw wrote:
>>>>>>"WD" == Walter Dörwald <firstname.lastname@example.org> writes:
> WD> Martin v. Loewis and I were discussing whether it would make
> WD> sense to make the helper method add_type (which is used for
> WD> adding a mapping between one type and one extension) visible
> WD> on the module level.
> WD> Any comments?
> +1 on add_types() being public, but it should probably have a strict
> flag to decide whether to add the new entry to the standard types dict
> or the common types dict.
OK, so we probably need a reverse mapping for common_types too, but
shouldn't we consider common_types to be fixed?
Maybe we should add a guess_all_types too, so we can handle duplicate
This would of course require to change the initialization of types_map
from a dict constant to many calls to add_type.
Even better would be, if we could assign priorities to the mappings,
so that for e.g. image/jpeg the preferred extension is .jpeg.
Then guess_type() and guess_extension() would return the preferred