La nuova BBS è in fase Alpha. I post precedenti al 22 luglio 2024 potrebbero non essere trasferibili, ma rimarranno disponibili per la lettura su /old/.
are python lists continuous memory or linked lists ?
-
are python lists continuous memory or linked lists ?
-
@fiore contiguous memory holding pointers to contents which gets reallocated once its size is exceeded
cpython/Objects/listobject.c at main · python/cpython
The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
GitHub (github.com)
-
@steffo@a.junimo.party that seems suboptimal ?? why didnt they just go with linked lists , i wonder ?
-
@fiore appending to them repeatedly becomes expensive very fast
-
@steffo@a.junimo.party makes sense i suppose , still , array of pointers seems like a cursed concept to me but ig its necessary since you can literally hold any type at any point of a list
-
@fiore yup!