Python Metalanguage confusticates and bebothers me...

Charles Hixson charleshixsn at earthlink.net
Tue Sep 12 18:33:52 CEST 2000


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...
>
> (Nobody expects the WHAT?!)
>
> Alex

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"]  )

-- (c) Charles Hixson
--  Addition of advertisements or hyperlinks to products specifically
prohibited

-------------- next part --------------
A non-text attachment was scrubbed...
Name: charleshixsn.vcf
Type: text/x-vcard
Size: 153 bytes
Desc: Card for Charles Hixson
URL: <http://mail.python.org/pipermail/python-list/attachments/20000912/e18cfcba/attachment.vcf>


More information about the Python-list mailing list