News for hackers. Stuff that matters.
Re:W3schools.dev Redirects to Mozilla Developer Network by geoelectric on Friday March 01, 2019 @01:20PM (#19283742)
It depends on how strictly one defines "array." If you mean it generically as "an indexable contiguous memory buffer containing the actual data being indexed," pretty sure Python lists don't comply even at a mechanical level.

While the Python 3 docs for arrays certainly do lean on the type-constraint, I notice it also has the various operations that imply a contiguous buffer (cast to bytes, etc.), so I wonder if that's not the real distinction and the type constraint serves that.

Traditional Python lists are much closer to what I know as a vector: indexable like an array, but dynamically expandable and usually implemented as a list of references to data structures instead of containing the data itself so allows for heterogenous data.

Informally, I've certainly called both types of things arrays, right or wrong, and rarely call anything a vector other than container classes by that name, but I do suspect that's what your parent comment is drilling on.

* Then there's the JS Array class, which acts more like a vector than array by those definitions, so who knows.

There are no comments on this comment yet.