Re:Python should not be taught as a foundational language
by kzrdude on Wednesday June 24, 2020 @09:27AM
(#23627599)
What do you mean by that it is a "list"? It's certainly not a linked list.
Re:Python should not be taught as a foundational language
by robsws on Wednesday June 24, 2020 @09:32AM
(#23627665)
An array by definition is fixed length and contiguous in memory. A list is variable length and not necessarily contiguous in memory.
Re:Python should not be taught as a foundational language
by detaro on Wednesday June 24, 2020 @09:31AM
(#23627648)
List is pretty much an interface, and Python lists do support things you expect from a List type, but not from an Array (e.g. inserting/removing things at random positions). The interface doesn't say if it's an array, a linked list, a rope, ... underneath, and you don't need to care at this point.
Re:Python should not be taught as a foundational language
by kzrdude on Thursday June 25, 2020 @09:21AM
(#23640403)
This is wrong, the Python list supports random access and random access inserts and removals. It's a dynamic size array underneath, and contiguous, so it's pretty much the same as a std::vector of Python objects.
Also notably a Python list does NOT have an efficent pop operation at both ends, only on the far end.
> For instance, what is called an "Array" in pretty much every mainstream language, is instead called a "List" in Python.
Because it is a list rather than an array (as in C).
> Another issue with Python is that it is essentially two different languages, there's Python 2.7 and Python 3+.
It's 2020, you are not supposed to teach Python 2 to newbies.
I was expecting more in-depth discussion, and the whole article is just way too superficial.