Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Python lets library authors write __enter__ and __exit__ dunder methods to ensure that memory deallocation is handled correctly via Python context managers, which is a much more elegant abstraction

Whats stopping you from writing a WrapperPtr and the drop trait for it in Rust? This would achieve the same as the dunder methods in python



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: