4 ms·
How a Python list really works? See the underlying C implementation: https://github.com/python/cpython/blob/main/Objects/listobject.c https://github.com/python/
by nayuki 5y ago
How a Python list really works? See the underlying C implementation: https://github.com/python/cpython/blob/main/Objects/listobject.c https://github.com/python/cpython/blob/main/Objects/listobje... ; https://github.com/python/cpython/blob/main/Include/listobject.h https://github.com/python/cpython/blob/main/Include/listobje...
For comparison, java.util.ArrayList is implemented in Java itself, and is much shorter: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/java/util/ArrayList.java http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/...
- azinman2 5y agoYa I was reading this thinking none of this is telling me how CPython implements it. It’s just a poor-man’s version.