3 ms·
>If GC is so good, why wouldn't Python just garbage collect everything, which they already did once and could trivially do I don't think python ever did pure m
by knome 4y ago
>If GC is so good, why wouldn't Python just garbage collect everything, which they already did once and could trivially do
I don't think python ever did pure mark-and-sweep ( cpython, at least, I'm sure jython and other alternate implementations have ).
My understanding was that they did pure reference counting, and kludged on a sweep GC to do cycle breaking eventually, as manually breaking cycles in early versions of python was a pain point. A quick lookup seems to indicate python1 was pure reference counting, and they added the cycle breaking when they released python2.
- cogman10 4y agoThat's my recollection as well (though I've not found evidence to support it). In fact, IIRC, as part of the python performance thing one of the topics was adding a proper generational GC into python for objects that don't refer to pinned memory.