Would it be possible to make the data-type objects subclassable, with the subclasses being able to override the equality test?

The range of data types that you've specified in the PEP are good enough for most general use, and probably for NumPy as well, but someone already came up with the example of image formats, which have their whole own range of data formats. I could throw in audio formats (bits per sample, excess-N or signed or ulaw samples, mono/stereo/5.1/etc, order of the channels), and there's probably a whole slew of other areas that have their own sets of formats.

If the datatype objects are subclassable, modules could initially start by adding their own formats. So, the "jackaudio" and "jillaudio" modules would have distinct sets of formats. But then later on it should be fairly easy for them to recognize each others formats. So, jackaudio would recognize the jillaudio format "msdos linear pcm" as being identical to its own "16-bit excess-32768".

Hopefully eventually all audio module writers would get together and define a set of standard audio formats. 


Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack

If I can't dance I don't want to be part of your revolution -- Emma Goldman