Live data from Hacker News

Python should not be taught as a foundational language

thedropout.dev

81–82 of 82 posts

Re: Python should not be taught as a foundational language

#81
post #80
post #33

Earlier quoted context omitted.

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.

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. Doc: https://docs.python.org/3/library/stdtypes.html#list

None of what you say seems to contradict what I said, so what exactly in my comment is wrong?

Re: Python should not be taught as a foundational language

#82
post #81
post #80

Earlier quoted context omitted.

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. Doc: https://docs.python.org/3/library/stdtypes.html#list

None of what you say seems to contradict what I said, so what exactly in my comment is wrong ?

I read that the list:

> but not from an Array (e.g. inserting/removing things at random positions)

But it does support those operations

Post reply on HN