mime types...

Richard Ryniker ryniker at alum.mit.edu
Mon Oct 17 15:48:36 UTC 2011


On Sun, 2011-10-16 at 21:46 -0700, Rob Healey wrote:
> So when working with python files, why is there no specific mime type for
> it?

Basically, because there is no need to tell the recipient of a Python
file how to specially format or interpret it.  It is simply one of a
large set of text files.

It can be necessary to know something about character encodings or
language (there are standardized descriptions of these attributes) for
text files in general, in order to read or display these files, just like
it can be necessary to know some other file contains image, video, or
sound data encoded in a particular way in order to access that
information.  Once you know an image is a JPEG file, it is not necessary
to know it is a picture of a horse in order to display it.

The "x-" attributes are chosen by users (or applications), they are not
defined characteristics established by MIME standards.  The standards
prescribe anything with an "x-" prefix to be a user-defined attribute,
intended to make it easier for applications to recognize data formats
designed specifically for their use.  Thus, "text/x-python" describes a
text file (which may have any of the standard MIME attributes defined for
use with text files), and also has the user-defined "x-python" attribute.
"x-Guido" could be used, if desired, or "x-python3", or "x-Python-2.7",
or many other variations - these are selected by the whim (or good sense)
of application authors.


More information about the test mailing list