3 ms·
What? Python is ref counted. It releases at the time an object goes out of scope and has no references anymore... exactly like ARC. Although Python says its gar
by FooBarWidget 13y ago
What? Python is ref counted. It releases at the time an object goes out of scope and has no references anymore... exactly like ARC. Although Python says its garbage collection is implementation-defined, in practice pretty much everybody uses CPython which uses refcounting. Where does the idea come from that Python releases at undeterministic time?
- duaneb 13y ago> Where does the idea come from that Python releases at undeterministic time? It's not the time that's undeterministic, it's that the 'deconstructor' may not be called at all if python can't guarantee collecting cyclical references in the right order. The object will still be released/deallocated. In this sense, Objective-C—mostly because you have complete control over the reference counting—has superior reference counting semantics. I'd like to note that there's nothing stopping Python from using similar approaches.