Elektrine lite

← Feed

@tias@discuss.tchncs.de

2026-10-06 15:01 UTC

You can’t, not in e.g. Java.

Replies (2)

  • It’s not impossible, at least in C# I know you can mark objects that need to be RAII with some custom attribute and enforce correct usage patterns with a custom analyzer. You need to write it yourself but it’s not impossible that way.

    Open ##4944392

  • @calcopiritus@lemmy.world 2026-10-07 05:26

    You can do some kind of RAII in python with the with keyword. Only works for local variables though, where it’s easy to free resources manually

    Open ##4948580