News for hackers. Stuff that matters.
Re:Why RAII rocks by czinck on Friday April 24, 2015 @11:40AM (#9434071)
I didn't have any example of extra power, just in with blocks you have some downsides compared to RAII but no upsides. By downsides I mean that in C++ you write the constructor/destructor and never worry about it again, but in python every caller has to use a with block, plus what I said above about exceptions being thrown before __enter__.

I haven't done much with mutexes, but doesn't having it split over 2 classes introduce a race condition? Seems like a weird way to implement it to me.

There are no comments on this comment yet.