News for hackers. Stuff that matters.
Re:Why Not Just Do Simple C++ RAII in C? by Doxin on Friday May 24, 2024 @04:10AM (#40464057)
I'm not super familiar with C++, but I imagine you'd need some chicanery to access privates, while in python you can just use them by name.
Re:Why Not Just Do Simple C++ RAII in C? by eru on Sunday May 26, 2024 @01:22AM (#40479940)
Well, you can always cast and access stuff by memory address.
Re:Why Not Just Do Simple C++ RAII in C? by mianos on Monday May 27, 2024 @02:42AM (#40488279)
I can't rally upvote this without breaking the rules about obscenities. But I'll give it a :)

In python, if any of this gives you an trouble you can just replace the stuff in the class dict with your own functions. You don't even need to cast.