[Numpy-discussion] Resize Method for Numpy Array
Thu Sep 24 17:32:09 CDT 2009
Robert Kern skrev:
> While this description is basically true of numpy arrays, I would
> caution you that every language has a different lexicon, and the same
> word can mean very different things in each. For example, Python lists
> are *not* linked lists; they are like C++'s std::vectors with a
> preallocation strategy to make appending cheap on average.
In Java and .NET jargon, Python lists are array lists, not linked lists.
It is sad there is no "cons" or "llist" built-in type, something like:
mycons = cons(car, cdr)
mylist = llist(iterable)
Of course we can write [car, cdr] or (car, cdr) for making linked lists
in pure Python (without having to define class types), but both have
issues.The first is storage inefficient, the latter is not mutable.
Yes I know Guido left out linked lists for a purpose, so there is
probably no use complaining on the Python ideas of Python dev lists...
More information about the NumPy-Discussion