> Lists in python are called lists because they're linked lists right?
No. At the C level in the interpreter they are arrays of object pointers.
> They are not called arrays because they are a different data structure.
No. They're not called arrays because Python uses the name "array" for something else:
How widely are Python arrays used in practice?
I haven't had much occasion to use them. I suspect that most use cases nowadays where the speed advantage is needed involve numerical computing where the user is probably using a library like numpy or scipy and will use their array implementation, not the built-in Python one. However, arrays have been around in Python since very early on, when those other numerical libraries didn't exist, so the array built-in might have gotten more use then.
Re:Reasons Python Sucks
by lights0123 on Saturday January 14, 2023 @07:30PM
(#34385533)
No, lists are implemented in CPython as an regular, contiguous array of PyObject. There is an array library (https://docs.python.org/3/library/array.html) for more efficient storage, comparable to JS's Uint8Array and friends.
Re:Reasons Python Sucks
by LightHugger on Saturday January 14, 2023 @07:30PM
(#34385534)
lists are arrays with different data types allowed per index
Lists in python are called lists because they're linked lists right? They are not called arrays because they are a different data structure.
Edit: Well TIL! Thanks everyone.