Python Metalanguage confusticates and bebothers me...

dmost at magna.com.au dmost at magna.com.au
Tue Sep 12 16:10:23 EDT 2000


In article <39BE5AEA.752ED9A3 at earthlink.net>,
  Charles Hixson <charleshixsn at earthlink.net> wrote:
>
> Alex Martelli wrote:
>
> > "Stephen Hansen" <stephen at cerebralmaelstrom.com> wrote in message
> > news:20000906.222838.20887 at Jeremy.cerebralmaelstrom.com...
> >     [snip]
> > > You see, Python has three kinds of arrays. To make things easier
> > > to understand, they are each called something distinct, and not
> > > 'immutable arrays', 'mutable dynamic-lengthed arrays' and
> > > 'associative arrays'. They're 'tuples', 'lists',
and 'dictionaries'.
> >
> > 3 kinds of arrays: tuples, lists, dictionaries, and the nice
> > little thing that comes up when you "import array"...:
> >
> > >>> import array
> > >>> x=array.array('c',"foo")
> > >>> type(x)
> > <type 'array'>
> > >>>
> >
> > Uh -- *four* kind of arrays, at least until NumPy and MatPy
> > stay out of the language proper... so, it's 4 kinds of arrays:
> > tuples, lists, dictionaries, arrays, and of course strings
> > are sequences and can be seen as arrays of charactes, so,
> > *five* kinds of arrays...
>
>
> And if one is using BerkeleyDB, 5 kinds of arrays, one disk based.
(If
> sorted/keyed lists could be included as a basic type, then one could
have
> something rather like a sliceable dictionary.  e.g.:  bingo = card
> ["a5":"g5"]  )


bingo = card["a5":"g5"]
this is a brilliant interface into ordered dictionaries


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list