logoalt Hacker News

kstrauser • today at 2:03 AM • 0 replies • view on HN

Python makes it easy to hold references to a lot of data forever such that it never gets garbage collected. The bad side is you need to be mindful of data lifetimes, and not, say, slap @cache on everything. The good side is that it’s possible to be mindful and keep that stuff down.

Honestly, hacking on Rust stuff’s been good for me as a Python programmer. It makes you have to pay attention to lifetimes and you can’t accidentally keep reference to all the things. Keeping its borrow checker happy reminded me about some Python good habits that are too easy to let slip.