[Python-Dev] standard library mimetypes module pathologically broken?

Jacob Rus jacobolus at gmail.com
Sat Aug 15 04:45:23 CEST 2009

11 Aug 2009, Benjamin Peterson wrote:
> 2009/8/11 Jacob Rus:
>> I have some other questions: How does one deprecate part of a standard
>> library API? How can we alert users to the deprecation? When can the
>> deprecated parts be removed?
> Basically, you add a DeprecationWarning to the API. Then remove it in
> the next major version.

Okay, I made another patch,


That adds some deprecation warnings to many of the functions/methods
in the module.

(I think the 'strict' parameters should also be deprecated. But I'm
considering actually making a new class, MimeTypesRegistry, or
something, and then just making its API stay mostly compatible with
MimeTypes, but extended to behave the way I think it should, and
deprecating the MimeTypes class altogether, making it a subclass in
the interim.)

Is there any way to explicitly (i.e. in code rather than docs)
deprecate string flags or dicts/lists from the module global
namespace? I don't think users should be mucking with the module's
singleton at all, and should be forced to make a new registry instance
to customize the behavior, so they don't break each-other's code.

> Then, you might garner some more reviews by putting your patch up on
> Rietveld; it makes reviewing much painful.

Okay, my last Rietveld link didn't get any eyeballs, but here's another try:


Jacob Rus

More information about the Python-Dev mailing list