top | item 38029624

(no title)

tene | 2 years ago

Lifetime analysis matters a lot for way more than just garbage collection.

File handles, iterators, mutex guards, database transaction handles, session types, scoped threads, anything where ordering or mutual exclusivity matters.

discuss

order

robertlagrant|2 years ago

I don't know about all of those, but Python's context managers and built in constructs handle most of those, I think?

Too|2 years ago

Only in the most basic cases. If your handle has to be passed into another function or outlive the current scope of your function, the guardrails end.