Hacker News new | ask | show | jobs
by ben-schaaf 3149 days ago
Unbinding a name does do one thing which might call `__del__`: It decreases the reference count by 1.
1 comments

In CPython, yes. But this is an implementation detail.
I learned this with PyPy (or maybe it was Jython?). My usual bad habit for small scripts to depend on open files to close when they went out of scope would suddenly exhausted all file descriptors. Ouch.