logoalt Hacker News

pjmlp • today at 7:22 AM • 1 reply • view on HN

For the same reason you need weakref in Python, to handle circular references in memory managed via reference counting GC algorithm.

https://docs.python.org/3/library/weakref.html

Anyone that thinks Python is "simple", to come back to some of the suggestions on how it is easier than C++, they really should learn the language reference, standard library, and CPython FFI manuals.


Replies

aleph_minus_one • today at 9:25 AM

> Anyone that thinks Python is "simple", to come back to some of the suggestions on how it is easier than C++, they really should learn the language reference, standard library, and CPython FFI manuals.

Python is more "simple" in the sense that

- it is more forgiving with respect to badly written code,

- it has collected less historical baggage than C++.

Otherwise I agree.

➕ show 1 reply