News for hackers. Stuff that matters.
Re:Rio-labs/rio: WebApps in pure Python. No JavaScript, HTML... by Phrodo_00 on Tuesday September 17, 2024 @12:53PM (#41569764)
Yeah and no? Python Lists indeed don't make any sort of array-like guarantee, but they're implemented as a vector/autogrowing-array of python object references (but these objects are not guaranteed to be cache-local).

The implementation defines the underlying data structure as PyObject *ob_item

Re:Rio-labs/rio: WebApps in pure Python. No JavaScript, HTML... by Sn3llius on Tuesday September 17, 2024 @01:26PM (#41570223)
List access is O(1), which effectively makes them arrays :)
Re:Rio-labs/rio: WebApps in pure Python. No JavaScript, HTML... by Phrodo_00 on Tuesday September 17, 2024 @01:35PM (#41570344)
Maybe if you don't consider CPU architecture, but most would expect to be able to do loops over Arrays that don't incur in a lot of cache misses, and Python Lists don't do that, since they're actually arrays of pointers to heap memory.