It's still I, Miville

KefX keflimarcusx at aol.comNOSPAM
Sun Nov 2 05:33:19 CET 2003

>You say in the definition of mappings that at present Python has only
>one type of it, the dictionnary.  I suggest another one, the sparse
>array, where absence of key would mean not absence of element but
>presence of a default-value element, such as zero for sparse arrays in
>the mathematical sense.

>From my understanding, this would be extremely easy: simply derive a new class
from the 'dict' type and add the functionality. In fact I think Guido van
Rossum used this very example in demonstrating the power of deriving from basic
types. There's no need to build spare-arrays into the language when we can
already do them without much trouble, though perhaps they could be added to the
library -- if they're not there already. I'm too lazy to look it up. ;)

- Kef

More information about the Python-list mailing list