[Python-Dev] PEP: Adding data-type objects to Python

Jack Jansen Jack.Jansen at cwi.nl
Mon Oct 30 16:40:19 CET 2006


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 at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Goldman


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20061030/7ae95590/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2255 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20061030/7ae95590/attachment.bin 


More information about the Python-Dev mailing list