3 ms·
Python is a very popular language where the list type is implemented as an array, and named a list. Calling these things vectors (C++, Rust) is unfortunate bec
by xscott 6y ago
Python is a very popular language where the list type is implemented as an array, and named a list. Calling these things vectors (C++, Rust) is unfortunate because you eventually want real vectors for working with matrices, and the behavior is different in that context.
As for linked lists, given modern processors and cache behavior, there are very few places where you ever want to chase pointers for a 1D data structure. It seems like a shame to lose a good name to a data structure that should now be avoided most of the time.
- remram 6y agoAn array of references. Plus, Python has no way to consume a contiguous array directly. If you do interoperate through FFI with code in C or similar, you will have to reach for numpy arrays, which are the typed, contiguous arrays of Python.