Michael Lazar <lazar.michae...@gmail.com> added the comment:

Greetings,

I just encountered this issue [0] and I agree with the sentiment that the 
documentation is currently misleading.

Particularly,

> By default, it provides access to the same database as the rest of this 
> module. The initial database is a copy of that provided by the module, and 
> may be extended by loading additional mime.types-style files into the 
> database using the read() or readfp() methods. The mapping dictionaries may 
> also be cleared before loading additional data if the default data is not 
> desired.

“as the rest of the module” implies to me that it should behave the same way as 
mimetypes.guess_type() does. The documentation only has one other reference to 
this built-in list of mimetypes, and the default values are hidden behind 
underscored variable names. I would re-word this as

"By default, it provides access to a database of well-known values defined 
internally by the python module. Unlike the other mimetypes convenience 
functions, it does not include definitions from the list of 
mimetypes.knownfiles. The initial database may be extended by loading 
additional mime.types-style files into the database using the read() or 
readfp() methods. The mapping dictionaries may also be cleared before loading 
additional data if the default data is not desired."

I would be happy to submit a PR if others agree.

[0] https://github.com/michael-lazar/jetforce/issues/38

----------
nosy: +michael-lazar

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to